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
|
|
|
|
|
2018-08-13 02:22:22 -05:00
|
|
|
# to start a different WM, set session below, or in console run:
|
2018-05-01 23:57:34 -05:00
|
|
|
# startx ~/.xinitrc WM
|
2018-04-19 01:43:29 -05:00
|
|
|
|
|
|
|
|
2018-06-30 20:43:00 -05:00
|
|
|
# session to run if none passed as first arg ($1)
|
|
|
|
session="${1:-openbox}"
|
2018-04-19 01:43:29 -05:00
|
|
|
|
2018-05-08 02:34:04 -05:00
|
|
|
# set environment wm for use in scripts
|
2018-02-04 10:09:32 -06:00
|
|
|
export WM="$session"
|
|
|
|
|
2018-06-30 20:43:00 -05:00
|
|
|
# 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
|
|
|
# user init scripts and settings
|
2018-05-08 02:34:04 -05:00
|
|
|
[ -f /etc/X11/xinit/.Xmodmap ] && xmodmap /etc/X11/xinit/.Xmodmap
|
|
|
|
[ -f ~/.Xmodmap ] && xmodmap ~/.Xmodmap
|
|
|
|
[ -f ~/.Xresources ] && xrdb -merge ~/.Xresources
|
|
|
|
[ -f ~/.xprofile ] && source ~/.xprofile
|
2018-04-19 01:43:29 -05:00
|
|
|
|
2018-06-30 20:43:00 -05:00
|
|
|
# some things to start for awesome
|
|
|
|
# other wm already have these started elsewhere
|
2018-06-09 18:51:08 -05:00
|
|
|
if [[ $session == "awesome" ]]; then
|
|
|
|
|
|
|
|
# keyring for storing passwords
|
|
|
|
if hash gnome-keyring &>/dev/null; then
|
|
|
|
gnome-keyring-daemon --start --components=pkcs11 &
|
|
|
|
fi
|
|
|
|
|
|
|
|
# gnome polkit
|
|
|
|
if [[ -x /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 ]]; then
|
|
|
|
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
|
|
|
|
fi
|
|
|
|
|
|
|
|
# simulate Alt+F1 with just pressing Super
|
|
|
|
if hash ksuperkey &>/dev/null; then
|
|
|
|
ksuperkey -e 'Super_L=Alt_L|F1' &
|
|
|
|
ksuperkey -e 'Super_R=Alt_L|F1' &
|
|
|
|
fi
|
2018-05-19 16:30:52 -05:00
|
|
|
fi
|
2018-05-01 23:57:34 -05:00
|
|
|
|
2018-05-08 02:34:04 -05:00
|
|
|
# display timeout and sleep
|
2018-07-27 20:05:21 -05:00
|
|
|
xset s 3600 3600
|
|
|
|
xset dpms 3600 3700 4000
|
2018-04-19 01:43:29 -05:00
|
|
|
|
|
|
|
# keyboard repeat rate
|
2018-07-27 20:05:21 -05:00
|
|
|
xset r rate 400 50
|
|
|
|
kbdrate -d 400 -r 50
|
2017-10-16 14:38:02 -05:00
|
|
|
|
2018-06-30 20:43:00 -05:00
|
|
|
# do NOT put commands below the exec lines
|
2017-12-07 22:20:42 -06:00
|
|
|
case $session in
|
2018-08-13 13:06:32 -05:00
|
|
|
i3|i3wm|i3-gaps) exec i3 ;;
|
2018-06-30 20:43:00 -05:00
|
|
|
bsp|bspwm) exec bspwm ;;
|
2018-05-18 22:36:34 -05:00
|
|
|
xfce|xfce4) exec startxfce4 ;;
|
2018-06-30 20:43:00 -05:00
|
|
|
openbox) exec openbox-session ;;
|
|
|
|
awesome) exec awesome ;;
|
|
|
|
*) exec "$session" # Unknown, try running it
|
2017-12-07 22:20:42 -06:00
|
|
|
esac
|