xinitrc/.xinitrc

100 lines
2.9 KiB
Bash

#!/bin/bash
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
[ -f $sysresources ] && xrdb -merge $sysresources
[ -f $sysmodmap ] && xmodmap $sysmodmap
[ -f "$userresources" ] && xrdb -merge "$userresources"
[ -f "$usermodmap" ] && xmodmap "$usermodmap"
# start any default scripts
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
#== Thurstylark additions below ==#
# Default screen locker
# Set DPMS timeout to 10 sec, force DPMS off,
# lock with i3lock without forking, then when
# unlocked, disable DPMS timeout.
SCREEN_LOCKER="xset dpms 0 0 10 dpms force off; i3lock --nofork -befc 000000; xset dpms 0 0 0"
# Default screen lock timeout in minutes
locktime=30
# Start ssh agent
eval $(ssh-agent)
# If srandrd is installed, start it up
[ -s /usr/bin/srandrd ] && srandrd ~/.config/srandrd.conf
# Thurstybook-specific config:
if [ "$(hostname)" == "thurstybook" ]; then
true # Add stuff here if I need it
fi
# dtarchaio-specific config:
if [ "$(hostname)" == "dtarchaio" ]; then
# Set screen lock timout to 15 minutes
locktime=15
# Set HDMI1 to be right of eDP1
xrandr --output eDP1 --auto --output HDMI1 --right-of eDP1
# Set the bell to be different from Matt's
xset b 75 750 50
# Set Touchscreen to only work on main display
xinput --map-to-output $(xinput list --id-only "Advanced Silicon S.A CoolTouch(TM) System") eDP1
fi
# Automatically lock after $locktime minutes using i3lock
xautolock -time $locktime -locker "$SCREEN_LOCKER" -detectsleep &
# Set DPMS features on, but disabled
xset +dpms dpms 0 0 0
# If numlockx is installed, turn numlock on
[ -s /usr/bin/numlockx ] && numlockx on
# Set st up as the default terminal for i3-sensible-terminal
export TERMINAL=st
# If $1 isn't set, use "i3"
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;;
i3|i3wm ) j4-make-config -a $(hostname).config archlinux # Create config
exec i3;;
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
*) exec $1;;
esac