2017-10-16 14:38:02 -05:00
|
|
|
#!/bin/sh
|
2017-12-01 00:21:33 -06:00
|
|
|
|
2018-04-19 01:43:29 -05:00
|
|
|
# this file is executed when calling startx
|
|
|
|
|
|
|
|
# To run different WM, run:
|
2018-05-01 23:57:34 -05:00
|
|
|
# startx ~/.xinitrc WM
|
2018-04-19 01:43:29 -05:00
|
|
|
|
|
|
|
|
|
|
|
# Session to run if none given
|
2017-12-07 22:20:42 -06:00
|
|
|
session=${1:-openbox}
|
2018-04-19 01:43:29 -05:00
|
|
|
|
|
|
|
# set ENV window manager for use in other scripts
|
2018-02-04 10:09:32 -06:00
|
|
|
export WM="$session"
|
|
|
|
|
2018-04-19 01:43:29 -05:00
|
|
|
# bspwm requires this to be set
|
|
|
|
export XDG_CONFIG_HOME=$HOME/.config
|
|
|
|
|
|
|
|
# Default Arch xinit scripts
|
2017-10-16 14:38:02 -05:00
|
|
|
if [ -d /etc/X11/xinit/xinitrc.d ]; then
|
2018-02-04 10:09:32 -06:00
|
|
|
for f in /etc/X11/xinit/xinitrc.d/*.sh; do
|
2017-12-01 00:21:33 -06:00
|
|
|
[ -x "$f" ] && . "$f"
|
|
|
|
done
|
2017-10-16 14:38:02 -05:00
|
|
|
fi
|
|
|
|
|
2018-04-19 01:43:29 -05:00
|
|
|
if [ -f /etc/X11/xinit/.Xmodmap ]; then
|
|
|
|
xmodmap /etc/X11/xinit/.Xmodmap
|
2018-02-04 10:09:32 -06:00
|
|
|
fi
|
2018-02-09 22:35:27 -06:00
|
|
|
|
2018-04-19 01:43:29 -05:00
|
|
|
# user init scripts and settings
|
2018-02-04 10:09:32 -06:00
|
|
|
if [ -f ~/.Xmodmap ]; then
|
|
|
|
xmodmap ~/.Xmodmap
|
|
|
|
fi
|
2018-02-09 22:35:27 -06:00
|
|
|
|
2018-04-19 01:43:29 -05:00
|
|
|
if [ -f ~/.Xresources ]; then
|
|
|
|
xrdb -merge ~/.Xresources
|
|
|
|
fi
|
|
|
|
|
2018-02-04 10:09:32 -06:00
|
|
|
if [ -f ~/.xprofile ]; then
|
2018-04-19 01:43:29 -05:00
|
|
|
source ~/.xprofile
|
2018-02-04 10:09:32 -06:00
|
|
|
fi
|
|
|
|
|
2018-04-19 01:43:29 -05:00
|
|
|
|
2018-05-01 23:57:34 -05:00
|
|
|
if hash gnome-keyring &>/dev/null; then
|
|
|
|
# keyring for storing passwords
|
|
|
|
gnome-keyring-daemon --start --components=pkcs11 &
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -x "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" ]; then
|
|
|
|
# run policy kit
|
|
|
|
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
|
|
|
|
fi
|
2018-04-19 01:43:29 -05:00
|
|
|
|
|
|
|
# keyboard repeat rate
|
2018-02-04 10:09:32 -06:00
|
|
|
kbdrate -d 400 -r 50
|
|
|
|
xset r rate 400 50
|
2018-04-19 01:43:29 -05:00
|
|
|
|
|
|
|
# display timeout
|
2018-02-04 10:09:32 -06:00
|
|
|
xset s 3600 3600
|
2017-10-16 14:38:02 -05:00
|
|
|
|
2018-04-19 01:43:29 -05:00
|
|
|
|
|
|
|
# Do NOT put code below this case statement
|
2017-12-07 22:20:42 -06:00
|
|
|
case $session in
|
2018-04-19 01:43:29 -05:00
|
|
|
i3|i3wm)
|
|
|
|
exec i3
|
|
|
|
;;
|
|
|
|
bsp|bspwm)
|
|
|
|
exec bspwm
|
|
|
|
;;
|
|
|
|
xfce|xfce4)
|
|
|
|
exec startxfce4
|
|
|
|
;;
|
|
|
|
openbox)
|
|
|
|
exec openbox-session
|
|
|
|
;;
|
2018-05-01 23:57:34 -05:00
|
|
|
dwm)
|
|
|
|
exec dwm
|
|
|
|
;;
|
2018-04-19 01:43:29 -05:00
|
|
|
*)
|
|
|
|
exec "$1" # Unknown, try running it
|
2017-12-07 22:20:42 -06:00
|
|
|
esac
|