darkman/00-do-not-repeat-yourself.bash: quote things in hopes of fixing things

This commit is contained in:
Aminda Suomalainen 2024-07-22 14:55:52 +03:00
parent bb1a379bca
commit 23ee3d5e02
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q

View File

@ -1,39 +1,41 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -x
if ! hash lsb_release 2> /dev/null; then if ! hash lsb_release 2> /dev/null; then
ERRORMESSAGE="lsb_release was not found, the wallpaper scripts cannot figure out the distribution" ERRORMESSAGE="lsb_release was not found, the wallpaper scripts cannot figure out the distribution"
echo $ERRORMESSAGE echo "$ERRORMESSAGE"
notify-send --app-name=darkman --icon=error $ERRORMESSAGE notify-send --app-name=darkman --icon=error "$ERRORMESSAGE"
exit 0 exit 0
fi fi
if ! hash kvantummanager 2> /dev/null; then if ! hash kvantummanager 2> /dev/null; then
ERRORMESSAGE="kvantummanager wasn't found, Qt theme switching won't work!" ERRORMESSAGE="kvantummanager wasn't found, Qt theme switching won't work!"
echo $ERRORMESSAGE echo "$ERRORMESSAGE"
notify-send --app-name="darkman" --icon=error $ERRORMESSAGE notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE"
exit 0 exit 0
fi fi
export DISTROID=$(lsb_release -si) export DISTROID="$(lsb_release -si)"
export DISTROREL=$(lsb_release -sr) export DISTROREL="$(lsb_release -sr)"
export DARKMANGET=$(darkman get) export DARKMANGET="$(darkman get)"
printf "Distribution: $DISTROID\nRelease: $DISTROREL\nMode: $DARKMANGET\n" printf "Distribution: $DISTROID\nRelease: $DISTROREL\nMode: $DARKMANGET\n"
if [[ "$DARKMANGET" == "dark" ]]; then if [[ "$DARKMANGET" -eq "dark" ]]; then
(notify-send --app-name="darkman" --urgency=low --icon=weather-clear-night "Teema: $DARKMANGET" &) (notify-send --app-name="darkman" --urgency=low --icon=weather-clear-night "Teema: $DARKMANGET" &)
elif [[ "$DARKMANGET" == "light" ]]; then elif [[ "$DARKMANGET" -eq "light" ]]; then
(notify-send --app-name="darkman" --urgency=low --icon=weather-clear "Teema: $DARKMANGET" &) (notify-send --app-name="darkman" --urgency=low --icon=weather-clear "Teema: $DARKMANGET" &)
else else
ERRORMESSAGE="Something went wrong?" ERRORMESSAGE="Something went wrong?"
echo $ERRORMESSAGE echo "$ERRORMESSAGE"
notify-send --app-name="darkman" --icon=error $ERRORMESSAGE notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE"
fi fi
if [[ "$QT_STYLE_OVERRIDE" != "kvantum" ]]; then if [[ "$QT_STYLE_OVERRIDE" != "kvantum" ]]; then
ERRORMESSAGE="\$QT_STYLE_OVERRIDE is not 'kvantum', Qt theme switching has no effect!" ERRORMESSAGE="\$QT_STYLE_OVERRIDE is not 'kvantum', Qt theme switching has no effect!"
echo $ERRORMESSAGE echo $ERRORMESSAGE
notify-send --app-name="darkman" --icon=error $ERRORMESSAGE notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE"
exit 0 exit 0
fi fi