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
SUBSYSTEM=="input", ENV{ID_BUS}=="usb", ENV{ID_INPUT_LEOPARD}=="?*", ACTION=="add", SYMLINK+="kbd%n", RUN+="/usr/local/bin/kbdctl m" | |
SUBSYSTEM=="input", ENV{ID_BUS}=="usb", ENV{ID_INPUT_LEOPARD}=="?*", ACTION=="remove", RUN+="/usr/local/bin/kbdctl a" |
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/python3 | |
# vim: tabstop=4 noexpandtab shiftwidth=4 softtabstop=0 | |
import json, string, subprocess, sys | |
def usage(mode=False): | |
if not mode: | |
suffix = '([--direction] {prev, next} | --name name | --num number)' | |
elif mode == 'name': | |
suffix = '--name name' |
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
Description='eduroam-monash' | |
Interface=wlp3s0 | |
Connection='wireless' | |
Security='wpa-configsection' | |
IP='dhcp' | |
WPAConfigSection=( | |
'ssid="eduroam"' | |
'key_mgmt=WPA-EAP' | |
'eap=PEAP' | |
'auth_alg=OPEN' |
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
ranger-cd() { | |
tempfile=$(mktemp) | |
ranger --choosedir="$tempfile" "${@:-$(pwd)}" < $TTY | |
test -f "$tempfile" && | |
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then | |
cd -- "$(cat "$tempfile")" | |
fi | |
rm -f -- "$tempfile" | |
# hacky way of transferring over previous command and updating the screen | |
VISUAL=true zle edit-command-line |
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 | |
file=~/Pictures/Screenshots/$(date +%y-%m-%d_%H-%M-%S).png | |
if [[ "$1" == "desktop" ]]; then | |
maim $file | |
elif [[ "$1" == "current" ]]; then | |
# maim -i $(xdotool getactivewindow) $file | |
maim -i $(xwininfo -id $(xwininfo -id $(xdotool getactivewindow) -children | grep "Parent window id" | sed -r "s/.*: (0x[0-9a-f]+) .*/\1/") | sed -r "s/.*: (0x[0-9a-f]+) .*/\1/" | head -n2 | tail -n1) -g $(xwininfo -id $(xwininfo -id $(xdotool getactivewindow) -children | grep "Parent window id" | sed -r "s/.*: (0x[0-9a-f]+) .*/\1/") | tail -n3 | head -n2 | py -l 'list(map(str.split,l))[1][1].replace("-","+").split("+")[0]+list(map(str.split,l))[0][1]') $file | |
else |
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 <iostream> | |
#include "Fraction.h" | |
Fraction::Fraction() { } | |
Fraction::Fraction(int a, int b) { | |
set(a, b); | |
} | |
Fraction::~Fraction() { } |
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 | |
cd /data/Games/osu\! | |
wine osu\! | |
while [ "$win" = "" ]; do | |
echo 'waiting for osu window' | |
sleep 0.05 | |
win=$(xwininfo -children -root -all | grep osu\!cuttingedge | sed -e "s/^.*\(0x[0-9a-f]\+\).*$/\1/") | |
done |
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
SUBSYSTEM=="block", ENV{ID_FS_UUID}=="548C310362B58070", ACTION=="add", SYMLINK+="ext", RUN+="/bin/systemctl daemon-reload", RUN += "/bin/systemctl start mnt-ex.automount" | |
SUBSYSTEM=="block", ENV{ID_FS_UUID}=="548C310362B58070", ACTION=="remove", RUN+="/bin/systemctl stop mnt-ex.automount" |
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
# create default device, outputs to just audio out | |
pcm.!default { | |
type asym | |
playback.pcm "plug:dmix0" | |
capture.pcm "dsnoop:PCH" | |
} | |
# outputs to both audio out and loopback | |
pcm.record { | |
type asym |
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 | |
termite -e "vim $*" |
OlderNewer