#!/usr/bin/env bash prepend_to_path() { local dir="$1" if [[ -d "${dir}" ]]; then if [[ ":$PATH:" != *"${dir}"* ]]; then export PATH="${dir}:${PATH}" fi fi } has?() { command -v "$1" > /dev/null 2>&1 } # Make sure "$HOME/bin" is in path prepend_to_path "$HOME/bin" # Local Hacks {{{ XRDB_OPTIONS='' [ -r "$HOME/.hacksrc" ] && . "$HOME/.hacksrc" # }}} # Load X Configuration test -f "$HOME/.Xresources" && xrdb $XRDB_OPTIONS -merge "$HOME/.Xresources" # test -f "$HOME/.xmodmap" && xmodmap "$HOME/.xmodmap" # Keyboard stuffs # --- # * use right-alt as Alt-Gr key ($ → £) # * use right ctrl key as compose (ctrl 1 2 → ½) # * use ctrl+alt+bksp to restart `X` # * Capslock → Ctrl # * Alt-Gr + Space = nbsp/Alt-Gr + Shift + Space = shy nbsp setxkbmap \ -layout us \ -variant altgr-intl \ -option compose:rctrl \ -option terminate:ctrl_alt_bksp \ -option ctrl:nocaps xset -b # Stop beeping at me (A.K.A turn off PC speaker) # xset r rate 330 60 # Set keyboard repeat rate # has? xcape && xcape -e 'Control_L=Escape' # https://github.com/alols/xcape # Disable automute {{{ # https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting # └─ Lennart Poettering ಠ_ಠ #has? amixer && amixer -c 0 sset "Auto-Mute Mode" Disabled # }}} # Cursor/Touch stuff {{{ # has? xsetroot && xsetroot -cursor_name left_ptr