Skip to content

Instantly share code, notes, and snippets.

@katafractari
Last active December 25, 2015 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katafractari/7010291 to your computer and use it in GitHub Desktop.
Save katafractari/7010291 to your computer and use it in GitHub Desktop.
bootstrap
#!/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