Skip to content

Instantly share code, notes, and snippets.

View Enzime's full-sized avatar
❄️
Nixing into the night

Michael Hoang Enzime

❄️
Nixing into the night
View GitHub Profile
@Enzime
Enzime / Zsh: change directory using ranger
Last active August 29, 2015 14:27 — forked from dbohdan/Zsh: change directory using ranger
Adopted from the "Bash: cd to last path after exit" example in the man page for ranger(1).
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
@Enzime
Enzime / eduroam-monash
Created August 18, 2015 09:36
netctl profile for connecting to eduroam at Monash
Description='eduroam-monash'
Interface=wlp3s0
Connection='wireless'
Security='wpa-configsection'
IP='dhcp'
WPAConfigSection=(
'ssid="eduroam"'
'key_mgmt=WPA-EAP'
'eap=PEAP'
'auth_alg=OPEN'
@Enzime
Enzime / i3-workspace-switcher
Created August 16, 2015 12:11
Switches workspaces!
#!/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'
@Enzime
Enzime / 98-input.rules
Created August 7, 2015 13:19
Disable internal laptop keyboard when external keyboard plugged in
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"