speedwm-personal/scripts/speedwm-compatcheck
speediegq 776a054830 Rework status functionality, save status bar to file, update various
other scripts by default so that all dependencies are forced. This is so
that people will actually install the dependencies. They are still not
100% forced as you can remove the line from Makefile.
2022-10-01 17:29:31 +02:00

65 lines
1.9 KiB
Bash
Executable file

#!/bin/sh
# speedwm-compatcheck
# compatibility checker used by 'make' when compiling speedwm.
BINDIR=$(cat /usr/share/speedwm/bindir)
# Check if xrdb exists
if [ -e "${BINDIR}xrdb" ]; then
xrdb_exists=true
else
printf "Error: ${BINDIR}xrdb was not found\n" && exit 1
fi
# Check if wmctrl exists
if [ -e "${BINDIR}wmctrl" ]; then
wmctrl_exists=true
else
printf "Error: ${BINDIR}wmctrl was not found\n" && exit 1
fi
# Check if xsetroot exists
if [ -e "${BINDIR}xsetroot" ]; then
xsetroot_exists=true
else
printf "Error: ${BINDIR}xsetroot was not found\n" && exit 1
fi
# Check if xwallpaper exists
if [ -e "${BINDIR}xwallpaper" ]; then
xwallpaper_exists=true
else
printf "Error: ${BINDIR}xwallpaper was not found\n" && exit 1
fi
# Check if xmodmap exists
if [ -e "${BINDIR}xmodmap" ]; then
xmodmap_exists=true
else
printf "Error: ${BINDIR}xmodmap was not found\n" && exit 1
fi
# Check if trayer exists
if [ -e "${BINDIR}trayer" ]; then
trayer_exists=true
elif [ -e "${BINDIR}trayer-srg" ]; then
trayer_exists=true
trayer_srg=true
fi
# Check if srg or not.
if [ "$trayer_exists" = "false" ]; then
if [ "$trayer_srg" = "true" ]; then
printf "WARNING: Before trayer-srg can be used instead of trayer, you must edit ~/.config/speedwm-de/systray/config and set USE_SRG to true.\n"
else
printf "WARNING: trayer was not found. This means the systray will not be available.\n"
fi
fi
# Check if dmenu exists
command -v dmenu > /dev/null || printf "\nWARNING: dmenu was not found. This means running applications will potentially be very inconvenient. It also means most bundled scripts will NOT work unless modified to work with rofi. See help for more information"
# Check if slock exists
command -v slock > /dev/null || printf "\nWARNING: slock was not found. This means the shutdown menu can't lock your screen."
result="$(echo "$xrdb_exists$wmctrl_exists$xsetroot_exists$xwallpaper_exists$xmodmap_exists$trayer_exists")"