xinitrc/xinitrc

100 lines
2.2 KiB
Bash

#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
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
if [ -f "$HOME/.xinitrc.extend" ] ; then
. "$HOME/.xinitrc.extend"
fi
if [ -f "$HOME/.screenlayout/layout.sh" ] ; then
. "$HOME/.screenlayout/layout.sh"
elif [ -f "$HOME/.config/randr/randr.sh" ] ; then
. "$HOME/.config/randr/randr.sh" &
elif [ -f "$HOME/.config/randr.sh" ] ; then
. "$HOME/.config/randr.sh" &
elif [ -f "$HOME/randr.sh" ] ; then
. "$HOME/randr.sh" &
fi
if [ -x "$(command -v unclutter)" ] ; then
unclutter --timeout 1 &
fi
setxkbmap gb
# keypress repeat rate
xset r rate 200 50
# mouse acceleration off
xset m 0 0
# reassign AltGR to Super_L
xmodmap -e "keycode 108 = Super_L"
# disable DPMS and screensaving
xset s off -dpms
if command -v xbindkeys ; then
xbindkeys
elif command -v sxhkd ; then
sxhkd &
fi
if [ -f "$HOME/.config/feh/fehbg" ] ; then
"$HOME/.config/feh/fehbg" &
fi
# fix giant cursors caused by adwaitu theme being installed as dependency of something.
# not working on patricia for some reason so workaround is to
# comment out `Inherits=Adwaita` in `/usr/share/icons/default/index.theme`
export XCURSOR_PATH=""
_host=$(hostname)
case "$_host" in
Patricia)
barriers --no-tray --debug ERROR --name Patricia -c ~/.config/barrier/barrier.conf --address 192.168.0.201:24800 &
;;
Pamela)
# TODO - why did i have these? do i still need them?
xrandr --dpi 96
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
# barrier client only works with a sleep (behaves as if Mod4 key is always being pressed) - why?
sleep 5 && barrierc --no-tray --debug ERROR --name Pamela 192.168.0.201:24800 &
;;
esac
bspwm
# if [ -f /usr/local/bin/start_dwm ] ; then
# exec /usr/local/bin/start_dwm
# else
# exec /usr/local/bin/dwm
# fi