Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.3 KiB

  1. #!/usr/bin/env bash
  2. prepend_to_path() {
  3. local dir="$1"
  4. if [[ -d "${dir}" ]]; then
  5. if [[ ":$PATH:" != *"${dir}"* ]]; then
  6. export PATH="${dir}:${PATH}"
  7. fi
  8. fi
  9. }
  10. has?() {
  11. command -v "$1" > /dev/null 2>&1
  12. }
  13. # Make sure "$HOME/bin" is in path
  14. prepend_to_path "$HOME/bin"
  15. # Local Hacks {{{
  16. XRDB_OPTIONS=''
  17. [ -r "$HOME/.hacksrc" ] && . "$HOME/.hacksrc"
  18. # }}}
  19. # Load X Configuration
  20. test -f "$HOME/.Xresources" && xrdb $XRDB_OPTIONS -merge "$HOME/.Xresources"
  21. # test -f "$HOME/.xmodmap" && xmodmap "$HOME/.xmodmap"
  22. # Keyboard stuffs
  23. # ---
  24. # * use right-alt as Alt-Gr key ($ → £)
  25. # * use right ctrl key as compose (ctrl 1 2 → ½)
  26. # * use ctrl+alt+bksp to restart `X`
  27. # * Capslock → Ctrl
  28. # * Alt-Gr + Space = nbsp/Alt-Gr + Shift + Space = shy nbsp
  29. setxkbmap \
  30. -layout us \
  31. -variant altgr-intl \
  32. -option compose:rctrl \
  33. -option terminate:ctrl_alt_bksp \
  34. -option ctrl:nocaps
  35. xset -b # Stop beeping at me (A.K.A turn off PC speaker)
  36. # xset r rate 330 60 # Set keyboard repeat rate
  37. # has? xcape && xcape -e 'Control_L=Escape' # https://github.com/alols/xcape
  38. # Disable automute {{{
  39. # https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting
  40. # └─ Lennart Poettering ಠ_ಠ
  41. #has? amixer && amixer -c 0 sset "Auto-Mute Mode" Disabled
  42. # }}}
  43. # Cursor/Touch stuff {{{
  44. # has? xsetroot && xsetroot -cursor_name left_ptr