X11:xinit: Check for commands existence

This commit is contained in:
2022-12-27 17:02:45 +01:00
parent df39b04cb2
commit 4adb3c4dbb

View File

@@ -34,14 +34,16 @@ unset {sys,user}{resources,modmap,xinitrcd}
# Key repeat rate
xset r rate 400 35
touchpad="DLL082A:01 06CB:76AF Touchpad"
xinput set-prop "$touchpad" "libinput Tapping Enabled" 1
xinput set-prop "$touchpad" "libinput Natural Scrolling Enabled" 1
xinput set-prop "$touchpad" "libinput Accel Speed" 0.45
unset touchpad
if command -v xinput >/dev/null 2>&1; then
touchpad="DLL082A:01 06CB:76AF Touchpad"
xinput set-prop "$touchpad" "libinput Tapping Enabled" 1
xinput set-prop "$touchpad" "libinput Natural Scrolling Enabled" 1
xinput set-prop "$touchpad" "libinput Accel Speed" 0.45
unset touchpad
fi
# Muted at startup
amixer -q -D pulse sset Master mute
! command -v amixer >/dev/null 2>&1 || amixer -q -D pulse sset Master mute
# Compositor
compositor="${XDG_CONFIG_HOME:-$HOME/.config}"/compositor/launch.sh
@@ -50,7 +52,7 @@ unset compositor
# Wallpaper
wallpaper="$HOME"/pics/wallpapers/wallpaper
feh --bg-scale --no-fehbg "$wallpaper"
! command -v feh >/dev/null 2>&1 || feh --bg-scale --no-fehbg "$wallpaper"
unset wallpaper
# Locker
@@ -58,4 +60,4 @@ locker="${XDG_CONFIG_HOME:-$HOME/.config}"/locker/launch.sh
[ ! -x "$locker" ] || "$locker"
unset locker
exec i3
! command -v i3 >/dev/null 2>&1 || exec i3