xinitrc/xinitrc

104 lines
2.8 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 command -v checkupdates ; then
if [ -f "$HOME/.checkupdates" ] ; then
rm "$HOME/.checkupdates"
fi
(checkupdates > "$HOME/.checkupdates") &
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,ru -option grp:shifts_toggle
# mouse acceleration off
xset m 0 0
# keyboard repeat rate
xset r rate 200 50
# reassign AltGR to Super_L
# xmodmap -e "keycode 108 = Super_L"
# disable DPMS and screensaving - doesn't work without a dely
# TODO does this now work with a dely?
(sleep 5s && xset s off -dpms) &
if command -v sxhkd ; then
/usr/bin/sxhkd -c "$HOME/.config/sxhkd/sxhkdrc" "$HOME/.config/sxhkd/sxhkdrc.bspwm" "$HOME/.config/sxhkd/sxhkdrc.bspwm.machineone" &
fi
if [ -f "$HOME/.config/feh/fehbg" ] ; then
"$HOME/.config/feh/fehbg" &
fi
# gnome keyring manager
dbus-update-activation-environment --all
gnome-keyring-daemon --start --components=secrets
# fix giant cursors caused by adwaitu theme being installed as dependency of something.
# not working on machineone 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
# MachineOne)
# barriers --no-tray --debug ERROR --name MachineOne -c ~/.config/barrier/barrier.conf --disable-crypto --disable-client-cert-checking --address 192.168.0.10:24800 &
# sleep 3 && "$HOME/.config/bspwm/border_flash.sh" &
# ;;
# esac
xsetroot -solid "#$(openssl rand -hex 3)" &
# (alacritty -e /usr/bin/sxhkd -c "$HOME/.config/sxhkd/sxhkdrc" "$HOME/.config/sxhkd/sxhkdrc.bspwm" "$HOME/.config/sxhkd/sxhkdrc.bspwm.machineone" & ) &
# (alacritty -e sh -c "/usr/bin/sxhkd -c \"$HOME/.config/sxhkd/sxhkdrc\" \"$HOME/.config/sxhkd/sxhkdrc.bspwm\" \"$HOME/.config/sxhkd/sxhkdrc.bspwm.machineone\"; exec bash" & ) &
# set compose key as right alt
setxkbmap -option compose:ralt
bspwm