2019-02-27 09:02:00 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-01-30 23:13:06 +00:00
|
|
|
userresources=$XDG_CONFIG_HOME/xresources/Xresources
|
|
|
|
usermodmap=$XDG_CONFIG_HOME/xresources/Xmodmap
|
2019-02-27 09:02:00 +00:00
|
|
|
sysresources=/etc/X11/xinit/.Xresources
|
|
|
|
sysmodmap=/etc/X11/xinit/.Xmodmap
|
|
|
|
|
|
|
|
# merge in defaults and keymaps
|
|
|
|
|
|
|
|
if [ -f $sysresources ]; then
|
2019-09-05 19:41:07 +00:00
|
|
|
xrdb -merge $sysresources
|
2019-02-27 09:02:00 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f $sysmodmap ]; then
|
2019-09-05 19:41:07 +00:00
|
|
|
xmodmap $sysmodmap
|
2019-02-27 09:02:00 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "$userresources" ]; then
|
2019-09-05 19:41:07 +00:00
|
|
|
xrdb -merge "$userresources"
|
2019-02-27 09:02:00 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "$usermodmap" ]; then
|
2019-09-05 19:41:07 +00:00
|
|
|
xmodmap "$usermodmap"
|
2019-02-27 09:02:00 +00:00
|
|
|
fi
|
|
|
|
|
2019-09-05 19:41:07 +00:00
|
|
|
if [ -d /etc/X11/xinit/xinitrc.d ]; then
|
|
|
|
for f in /etc/X11/xinit/xinitrc.d/?*.sh; do
|
2020-02-01 14:17:10 +00:00
|
|
|
# shellcheck disable=1090
|
2019-09-05 19:41:07 +00:00
|
|
|
[ -x "$f" ] && . "$f"
|
|
|
|
done
|
|
|
|
unset f
|
2019-02-27 09:02:00 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Remaps Capslock key to control.
|
|
|
|
# (only works for x environment - I haven't needed it for non-x yet)
|
|
|
|
setxkbmap -option ctrl:nocaps
|
2019-04-24 13:29:25 +00:00
|
|
|
# sets default to EURkey layout, with possibility to switch to german
|
2019-05-22 14:11:01 +00:00
|
|
|
# sets german layout to be default for the only pc I have with a german keyboard
|
2020-06-15 18:33:37 +00:00
|
|
|
# shellcheck disable=2039
|
|
|
|
if [ "$HOST" = "lidell" ] || [ "$HOSTNAME" = "lidell" ]; then
|
2019-05-22 14:11:01 +00:00
|
|
|
setxkbmap -layout eu,de
|
2020-06-15 18:33:37 +00:00
|
|
|
else
|
|
|
|
setxkbmap -layout de,eu
|
2019-05-22 14:11:01 +00:00
|
|
|
fi
|
2019-03-10 13:18:05 +00:00
|
|
|
# allows switching layouts with alt+space
|
|
|
|
setxkbmap -option grp:alt_shift_toggle
|
2019-02-27 09:02:00 +00:00
|
|
|
|
|
|
|
# Makes Capslock behave as escape - when ONLY capslock is pressed and released
|
|
|
|
# this only works when we already substitute a ctrl for caps with the lines above,
|
|
|
|
# otherwise control itself will act as escape.
|
|
|
|
# Needs xcape package installed. https://github.com/alols/xcape
|
2019-11-21 11:14:31 +00:00
|
|
|
# set a timeout of 500ms, if pressed longer it will ignore esc
|
|
|
|
type xcape >/dev/null 2>&1 && xcape -e 'Control_L=Escape' -t 500
|
2019-02-27 09:02:00 +00:00
|
|
|
|
2020-05-05 07:21:38 +00:00
|
|
|
# unclutter is a program to hide your mouse cursor when it is not moved
|
2019-03-15 12:44:48 +00:00
|
|
|
type unclutter >/dev/null 2>&1 && unclutter &
|
2020-05-05 07:21:38 +00:00
|
|
|
# picom is the maintained version of desktop compositor compton
|
2019-11-30 10:41:42 +00:00
|
|
|
type picom >/dev/null 2>&1 && picom &
|
2019-03-12 16:55:18 +00:00
|
|
|
|
2019-05-22 12:46:48 +00:00
|
|
|
# if sxhkd - the key-binding daemon is installed, start it up
|
2020-05-29 12:01:47 +00:00
|
|
|
type sxhkd >/dev/null 2>&1 && sxhkd-piped &
|
2019-05-22 12:46:48 +00:00
|
|
|
|
2019-12-02 18:02:21 +00:00
|
|
|
# if nextcloud-client exists, start it up
|
|
|
|
type nextcloud >/dev/null 2>&1 && nextcloud --background &
|
|
|
|
|
2020-05-05 07:21:38 +00:00
|
|
|
# load nm-applet, to allow easy vpn setting/switching from x interface
|
|
|
|
# TODO this should over time be replaced with a custom polybar interface
|
|
|
|
type nm-applet >/dev/null 2>&1 && nm-applet &
|
|
|
|
|
2019-04-12 12:41:35 +00:00
|
|
|
# additional config options for Touchpad devices ONLY
|
2021-01-26 11:33:59 +00:00
|
|
|
if [ "$(journalctl --dmesg -o short-monotonic --no-hostname --no-pager | grep -c "Touchpad")" -gt 0 ]; then
|
2019-04-12 12:41:35 +00:00
|
|
|
# enable touch tapping for XPS13 touchpad - for different devices get the touchpad name with xinput list-prop <TAB>
|
|
|
|
xinput set-prop "DLL075B:01 06CB:76AF Touchpad" "libinput Tapping Enabled" 1
|
|
|
|
fi
|
|
|
|
|
2019-02-27 09:02:00 +00:00
|
|
|
type i3 >/dev/null 2>&1 && exec i3
|