dotfiles/shell/.xsessionrc

32 lines
700 B
Plaintext

# Load .profile
if [ -f ~/.profile ]; then
. ~/.profile
fi
xrdb -merge ~/.Xresources
# Load settings for HiDPI only when HiRes display is connected
#
SR=$(xrandr --query | grep ' connected' | egrep -o '[0-9]+x[0-9]+\+[0-9]+\+[0-9]+')
MAX_RES=0
for RES in $SR
do
SRX=$(echo $RES | cut -d'x' -f 1)
if [ $MAX_RES -lt $SRX ]; then
MAX_RES=$SRX
fi
done
# FullHD
if [ "$MAX_RES" -le 1920 ]; then
xrdb -merge ~/.Xresources.d/lowdpi
# 2k
elif [ "$MAX_RES" -gt 1920 ] && [ "$MAX_RES" -le 2560 ]; then
xrdb -merge ~/.Xresources.d/middpi
elif [ "$MAX_RES" -gt 2560 ]; then
xrdb -merge ~/.Xresources.d/hidpi
fi
# Set Keyboard layout
setxkbmap -layout eu,de -option grp:rctrl_rshift_toggle