The configuration of Collin Doering
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.

90 lines
2.3KB

  1. #!/bin/zsh
  2. #
  3. # ~/.xinitrc
  4. #
  5. # Executed by startx (run your window manager from here)
  6. # GENERIC #
  7. # Usage: .xinitrc [window-manager] [session-type]
  8. # where: window-manager is one of '(xmonad openbox stumpwm awesome pekwm)
  9. # session-type is either "local" or "remote"; upon "" defaults to "local"
  10. # Runs system-wide xinitrc scripts
  11. if [ -d /etc/X11/xinit/xinitrc.d ]; then
  12. for f in /etc/X11/xinit/xinitrc.d/*; do
  13. [ -x "$f" ] && . "$f"
  14. done
  15. unset f
  16. fi
  17. # Set the default curson used by all WM's
  18. xsetroot -cursor_name left_ptr
  19. # Allow swithing to/from US qwerty and dvorak layouts
  20. setxkbmap -layout us,us -variant ,dvorak -option grp:sclk_toggle
  21. # Initialize a local desktop session (run generic helper applications)
  22. function init_local_session() {
  23. # Set a desktop background
  24. nitrogen --restore &
  25. # Load Xresources
  26. xrdb -merge ~/.Xresources
  27. # Create variable GENERAL_SCREEN which is the pid of a screen called "general"
  28. GENERAL_SCREEN=`screen -ls | grep general | cut -f1 -d'.' | sed 's/\W//g'`
  29. # Check to see if a general screen is already running
  30. # DEPRECIATED in favor of tmux which is started by systemd
  31. #if [ "x$GENERAL_SCREEN" == "x" ]; then
  32. # screen -dmS general &
  33. #fi
  34. # Start X applications that can't be started from user systemd services
  35. start-pulseaudio-x11 &
  36. unclutter &
  37. xcompmgr &
  38. xbindkeys &
  39. xscreensaver -no-splash &
  40. deskcon-server &
  41. emacs --daemon &
  42. # Set the default wm to xmonad
  43. DEFAULT_WM=xmonad
  44. }
  45. # Initialize a remote desktop session (run generic helper applications)
  46. function init_remote_session() {
  47. # Set desktop background
  48. feh --bg-scale ~/.wallback/Cocaine_Wallpaper_II_by_mdornfeld.png &
  49. # Set the default wm to xmonad
  50. DEFAULT_WM=stumpwm
  51. }
  52. # Check the second cl parameter which denotes the session-type (E.g. remote, local)
  53. case "$2" in
  54. # Remote session
  55. remote)
  56. init_remote_session
  57. break
  58. ;;
  59. # Local session or unspecified
  60. *)
  61. init_local_session
  62. ;;
  63. esac
  64. # Check the first cl parameter which denotes the window-manager to use
  65. # Notice: in each case expression below "exec app" hands over execution to some app thus
  66. # ceasing execution in this script so no "break" is required
  67. case "$1" in
  68. xmonad|openbox|stumpwm|awesome|pekwm)
  69. exec "$1"
  70. ;;
  71. *)
  72. exec "$DEFAULT_WM"
  73. ;;
  74. esac