My misc dotfiles (will likely dramatically change at random times, so the git history will likely be unclean, nonexistent, or otherwise bad practices). This is mostly for backup and in case anyone's curious
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.

71 lines
1.6 KiB

  1. #!/bin/bash
  2. #
  3. # ~/.xinitrc
  4. #
  5. # Executed by startx (run your window manager from here)
  6. userresources=$HOME/.Xresources
  7. usermodmap=$HOME/.Xmodmap
  8. sysresources=/etc/X11/xinit/.Xresources
  9. sysmodmap=/etc/X11/xinit/.Xmodmap
  10. DEFAULT_SESSION='i3 --shmlog-size 8000000'
  11. # merge in defaults and keymaps
  12. if [ -f $sysresources ]; then
  13. xrdb -merge $sysresources
  14. fi
  15. if [ -f $sysmodmap ]; then
  16. xmodmap $sysmodmap
  17. fi
  18. if [ -f "$userresources" ]; then
  19. xrdb -merge "$userresources"
  20. fi
  21. if [ -f "$usermodmap" ]; then
  22. xmodmap "$usermodmap"
  23. fi
  24. # start some nice programs
  25. if [ -d /etc/X11/xinit/xinitrc.d ] ; then
  26. for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  27. [ -x "$f" ] && . "$f"
  28. done
  29. unset f
  30. fi
  31. get_session(){
  32. #local dbus_args=(--sh-syntax --exit-with-session) # <-- broken, use below
  33. local dbus_args=(--sh-syntax)
  34. case $1 in
  35. awesome) dbus_args+=(awesome) ;;
  36. bspwm) dbus_args+=(bspwm-session) ;;
  37. budgie) dbus_args+=(budgie-desktop) ;;
  38. cinnamon) dbus_args+=(cinnamon-session) ;;
  39. deepin) dbus_args+=(startdde) ;;
  40. enlightenment) dbus_args+=(enlightenment_start) ;;
  41. fluxbox) dbus_args+=(startfluxbox) ;;
  42. gnome) dbus_args+=(gnome-session) ;;
  43. i3|i3wm) dbus_args+=(i3 --shmlog-size 0) ;;
  44. jwm) dbus_args+=(jwm) ;;
  45. kde) dbus_args+=(startplasma-x11) ;;
  46. lxde) dbus_args+=(startlxde) ;;
  47. lxqt) dbus_args+=(lxqt-session) ;;
  48. mate) dbus_args+=(mate-session) ;;
  49. xfce) dbus_args+=(xfce4-session) ;;
  50. openbox) dbus_args+=(openbox-session) ;;
  51. *) dbus_args+=($DEFAULT_SESSION) ;;
  52. esac
  53. # echo "${dbus_args[*]}" # if broken, try this
  54. echo "dbus-launch ${dbus_args[*]}"
  55. }
  56. # turn off annoying beep
  57. xset b off
  58. exec $(get_session "$1")