Last active
December 25, 2015 16:59
-
-
Save katafractari/7010291 to your computer and use it in GitHub Desktop.
bootstrap
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 - | |
hooks="bootstrap_bash" | |
xorg_hooks="remap_keys" | |
### Hooks | |
function bootstrap_bash() { | |
set -o vi | |
} | |
### Xorg hooks | |
# Map Escape => Caps Lock | |
function remap_keys() { | |
xmodmap -e 'remove Lock = Caps_Lock' 2> /dev/null | |
xmodmap -e 'keysym Caps_Lock = Escape' 2> /dev/null | |
} | |
### Process hooks | |
for hook in $hooks; do | |
echo "Executing xorg hook: $hook" | |
$hook | |
done | |
### Process Xorg hooks | |
x_running=$(pidof X) | |
if [ ${#x_running} -gt 0 ]; then | |
for hook in $xorg_hooks; do | |
echo "Executing xorg hook: $hook" | |
$hook | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment