2016-04-28 15:30:04 +00:00
|
|
|
#!/bin/bash
|
2016-01-20 18:28:26 +00:00
|
|
|
|
|
|
|
userresources=$HOME/.Xresources
|
|
|
|
usermodmap=$HOME/.Xmodmap
|
|
|
|
sysresources=/etc/X11/xinit/.Xresources
|
|
|
|
sysmodmap=/etc/X11/xinit/.Xmodmap
|
|
|
|
|
|
|
|
# merge in defaults and keymaps
|
2016-04-11 17:25:45 +00:00
|
|
|
[ -f $sysresources ] && xrdb -merge $sysresources
|
|
|
|
[ -f $sysmodmap ] && xmodmap $sysmodmap
|
|
|
|
[ -f "$userresources" ] && xrdb -merge "$userresources"
|
|
|
|
[ -f "$usermodmap" ] && xmodmap "$usermodmap"
|
|
|
|
|
2016-01-20 18:28:26 +00:00
|
|
|
|
2017-01-20 17:52:44 +00:00
|
|
|
# start any default scripts
|
2016-01-20 18:28:26 +00:00
|
|
|
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
|
|
|
|
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
|
2019-05-17 13:59:28 +00:00
|
|
|
# shellcheck source=/dev/null
|
2016-01-20 18:28:26 +00:00
|
|
|
[ -x "$f" ] && . "$f"
|
|
|
|
done
|
|
|
|
unset f
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2016-01-25 16:28:12 +00:00
|
|
|
#== Thurstylark additions below ==#
|
2017-02-16 08:29:56 +00:00
|
|
|
# Reference: https://wiki.thurstylark.com/Xinitrc.html
|
2016-01-25 16:28:12 +00:00
|
|
|
|
2017-02-16 08:29:56 +00:00
|
|
|
# Set st up as the default terminal for i3-sensible-terminal
|
|
|
|
export TERMINAL=st
|
2017-01-20 17:52:44 +00:00
|
|
|
# Default screen locker
|
2017-02-16 08:29:56 +00:00
|
|
|
|
2017-01-20 17:52:44 +00:00
|
|
|
# Set DPMS timeout to 10 sec, force DPMS off,
|
|
|
|
# lock with i3lock without forking, then when
|
|
|
|
# unlocked, disable DPMS timeout.
|
2017-02-16 08:29:56 +00:00
|
|
|
screen_locker="xset dpms 0 0 10 dpms force off; i3lock --nofork -befc 000000; xset dpms 0 0 0"
|
|
|
|
locktime=30 # Default screen lock timeout in minutes
|
2017-01-20 17:52:44 +00:00
|
|
|
|
2019-05-17 13:59:28 +00:00
|
|
|
# Set DPMS features on, but disabled
|
|
|
|
xset +dpms dpms 0 0 0
|
2016-10-12 15:06:25 +00:00
|
|
|
|
2019-05-17 13:59:28 +00:00
|
|
|
# Start ssh agent
|
|
|
|
eval "$(ssh-agent)"
|
2016-01-20 18:28:26 +00:00
|
|
|
|
2017-02-16 08:29:56 +00:00
|
|
|
# If srandrd is installed, start it up
|
|
|
|
# ALL display/xrandr and touchscreen setup should be configured in ~/.config/srandrd.conf!
|
|
|
|
if [ -s /usr/bin/srandrd ]; then
|
|
|
|
srandrd ~/.config/srandrd.conf
|
|
|
|
else
|
|
|
|
printf "==== FATAL: srandrd does not appear to be installed! ===="
|
|
|
|
exit 1
|
2017-01-20 17:52:44 +00:00
|
|
|
fi
|
2016-03-23 23:24:32 +00:00
|
|
|
|
2017-02-16 08:29:56 +00:00
|
|
|
# Host-specific config
|
|
|
|
case "$(hostname)" in
|
|
|
|
"dtarchaio")
|
|
|
|
locktime=15 # Screen lock timeout
|
|
|
|
xset b 75 750 50 # Set the bell to be different from Matt's
|
|
|
|
;;
|
|
|
|
esac
|
2016-01-25 16:28:12 +00:00
|
|
|
|
2017-01-20 17:52:44 +00:00
|
|
|
# Automatically lock after $locktime minutes using i3lock
|
2017-02-16 08:29:56 +00:00
|
|
|
xautolock -time $locktime -locker "$screen_locker" -detectsleep &
|
2017-01-20 17:52:44 +00:00
|
|
|
|
2016-10-18 14:01:06 +00:00
|
|
|
# If numlockx is installed, turn numlock on
|
2016-04-28 15:30:04 +00:00
|
|
|
[ -s /usr/bin/numlockx ] && numlockx on
|
2016-04-11 17:25:45 +00:00
|
|
|
|
2019-05-17 14:35:15 +00:00
|
|
|
# Hide cursor when any key is pressed
|
|
|
|
xbanish
|
2016-08-05 17:12:22 +00:00
|
|
|
|
2016-10-18 14:01:06 +00:00
|
|
|
# If $1 isn't set, use "i3"
|
2016-01-20 18:28:26 +00:00
|
|
|
session=${1:-i3}
|
|
|
|
|
|
|
|
case $session in
|
|
|
|
awesome ) exec awesome;;
|
|
|
|
bspwm ) exec bspwm;;
|
|
|
|
catwm ) exec catwm;;
|
|
|
|
cinnamon ) exec cinnamon-session;;
|
|
|
|
dwm ) exec dwm;;
|
|
|
|
enlightenment ) exec enlightenment_start;;
|
|
|
|
ede ) exec startede;;
|
|
|
|
fluxbox ) exec startfluxbox;;
|
|
|
|
gnome ) exec gnome-session;;
|
|
|
|
gnome-classic ) exec gnome-session --session=gnome-classic;;
|
2019-05-17 13:59:28 +00:00
|
|
|
i3|i3wm ) j4-make-config -a "$(hostname)".config archlinux # Create config
|
2016-12-20 18:26:17 +00:00
|
|
|
exec i3;;
|
2016-01-20 18:28:26 +00:00
|
|
|
icewm ) exec icewm-session;;
|
|
|
|
jwm ) exec jwm;;
|
|
|
|
kde ) exec startkde;;
|
|
|
|
mate ) exec mate-session;;
|
|
|
|
monster|monsterwm ) exec monsterwm;;
|
|
|
|
notion ) exec notion;;
|
|
|
|
openbox ) exec openbox-session;;
|
|
|
|
unity ) exec unity;;
|
|
|
|
xfce|xfce4 ) exec startxfce4;;
|
|
|
|
xmonad ) exec xmonad;;
|
|
|
|
# No known session, try to run it as command
|
2019-05-17 13:59:28 +00:00
|
|
|
*) exec "$1";;
|
2016-01-20 18:28:26 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
|