dotfiles/.xinitrc

57 lines
1.1 KiB
Text
Raw Permalink Normal View History

2023-05-03 14:36:45 +01:00
#!/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
2024-02-22 13:39:09 +00:00
xrdb -merge $sysresources
2023-05-03 14:36:45 +01:00
fi
if [ -f $sysmodmap ]; then
2024-02-22 13:39:09 +00:00
xmodmap $sysmodmap
2023-05-03 14:36:45 +01:00
fi
if [ -f "$userresources" ]; then
2024-02-22 13:39:09 +00:00
xrdb -merge "$userresources"
2023-05-03 14:36:45 +01:00
fi
if [ -f "$usermodmap" ]; then
2024-02-22 13:39:09 +00:00
xmodmap "$usermodmap"
2023-05-03 14:36:45 +01:00
fi
# start some nice programs
2024-02-22 13:39:09 +00:00
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh; do
[ -x "$f" ] && . "$f"
done
unset f
2023-05-03 14:36:45 +01:00
fi
2023-05-21 18:18:04 +01:00
if [ -f /usr/bin/prime-offload ]; then
2024-02-22 13:39:09 +00:00
/usr/bin/prime-offload
2023-05-03 14:36:45 +01:00
fi
2024-09-27 16:54:50 +01:00
/usr/lib/xfce-polkit/xfce-polkit &
2024-08-31 18:01:10 +01:00
/usr/bin/xscreensaver -no-splash &
2024-02-22 13:39:09 +00:00
# setup monitors (laptop only)
if [ -f /usr/bin/envycontrol ]; then
gpu_mode=$(/usr/bin/envycontrol -q)
if [ "$gpu_mode" = "nvidia" ]; then
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
xrandr --output HDMI-0 --above eDP-1-1
xrandr --output HDMI-0 --primary
else
xrandr --auto
xrandr --output HDMI-1-0 --above eDP-1
xrandr --output HDMI-1-0 --primary
fi
2023-05-03 14:36:45 +01:00
fi
2024-02-22 13:39:09 +00:00
2023-05-18 11:52:03 +01:00
exec i3