This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lua | |
conky_color = "${color1}%2d${color}" | |
t = os.date('*t', os.time()) | |
year, month, currentday = t.year, t.month, t.day | |
daystart = os.date("*t",os.time{year=year,month=month,day=01}).wday | |
month_name = os.date("%B") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S bash -e | |
# REPO='https://gitlab.gnome.org/GNOME/vte.git' | |
REPO='https://github.com/GNOME/vte.git' | |
LIBPATH='/usr/local/lib/x86_64-linux-gnu' | |
LDCONFPATH='/etc/ld.so.conf' | |
# See Deps: | |
# https://github.com/GNOME/vte/blob/master/meson.build | |
# On Ubuntu 21.04, GNOME-Terminal 3.38.1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rofi -dump-config | |
configuration { | |
/* modi: "window,run,ssh";*/ | |
/* font: "mono 12";*/ | |
/* location: 0;*/ | |
/* yoffset: 0;*/ | |
/* xoffset: 0;*/ | |
/* fixed-num-lines: true;*/ | |
/* show-icons: false;*/ | |
/* terminal: "rofi-sensible-terminal";*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc test.c -lX11 -lXext | |
/* Some clumsy app to test X11 Shape extension. | |
* | |
* The app window consists of three zones: | |
* +-------+ | |
* | A | | |
* +---+---+ | |
* | B | C | | |
* +---+---+ | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; hello_world.asm | |
; | |
; Author: John Hammond | |
global _start | |
section .text: | |
_start: | |
mov eax, 0x4 ; use the write syscall | |
mov ebx, 1 ; use the stdout as fd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <X11/Xlib.h> | |
#include <X11/Xatom.h> | |
#include <X11/Xutil.h> | |
#include <X11/extensions/shape.h> | |
#include <X11/extensions/Xfixes.h> | |
#include <pango/pangocairo.h> | |
#include <cairo.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#shows the current io usage | |
function iomonitor { | |
OLD=`awk '{print $1}' /sys/block/sda/stat` # First field is number of read I/Os processed | |
DT=1 | |
for i in /sys/block/sda/stat | |
do | |
sleep $DT | |
NEW=`awk '{print $1}' /sys/block/sda/stat` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch --difference=cummulative --interval=1 '(echo device read_IOs read_merges read_sectors read_ticks write_IOs write_merges write_sectors write_ticks in_flight io_ticks time_in_queue; for file in /sys/block/*/stat; do echo -n $file; cat $file; done) | column -t' | |
# OUTPUTS: | |
#device read_IOs read_merges read_sectors read_ticks write_IOs write_merges write_sectors write_ticks in_flight io_ticks time_in_queue | |
#/sys/block/dm-0/stat 116962 0 2212746 314096 7705653 0 150218536 609670232 0 644428 610921004 | |
#/sys/block/dm-1/stat 116479 0 2208882 313324 7686986 0 150218536 609676068 0 644616 611418072 | |
#/sys/block/dm-2/stat 302 0 2416 780 0 0 0 0 0 148 780 | |
#/sys/block/sda/stat 91181 26273 2217246 74876 7314854 388030 150261802 16954364 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if xdotool search --class "mpv"; then | |
echo "process exists" | |
scbc=$(zenity --entry --title="Youtube" --text="searching for:") | |
[[ "$?" != "0" ]] && exit 1 | |
echo "{ \"command\": [\"loadfile\", \"ytdl://ytsearch100:$scbc\" ] }" | socat - /tmp/mpvsocket | |
else | |
echo "process not exists" | |
coproc mpv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -*- coding:utf-8-unix; mode:c; -*- | |
// | |
// get the active window on X window system | |
// | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <locale.h> | |
#include <X11/Xlib.h> // `apt-get install libx11-dev` |