2024-07-22 11:09:56 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-07-22 13:55:52 +02:00
|
|
|
set -x
|
|
|
|
|
2024-07-20 06:49:15 +02:00
|
|
|
if ! hash lsb_release 2> /dev/null; then
|
|
|
|
ERRORMESSAGE="lsb_release was not found, the wallpaper scripts cannot figure out the distribution"
|
2024-07-22 13:55:52 +02:00
|
|
|
echo "$ERRORMESSAGE"
|
|
|
|
notify-send --app-name=darkman --icon=error "$ERRORMESSAGE"
|
2024-07-22 10:39:29 +02:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! hash kvantummanager 2> /dev/null; then
|
|
|
|
ERRORMESSAGE="kvantummanager wasn't found, Qt theme switching won't work!"
|
2024-07-22 13:55:52 +02:00
|
|
|
echo "$ERRORMESSAGE"
|
|
|
|
notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE"
|
2024-07-20 06:49:15 +02:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2024-07-22 13:55:52 +02:00
|
|
|
export DISTROID="$(lsb_release -si)"
|
|
|
|
export DISTROREL="$(lsb_release -sr)"
|
2024-07-20 07:01:17 +02:00
|
|
|
|
2024-07-22 13:55:52 +02:00
|
|
|
export DARKMANGET="$(darkman get)"
|
2024-07-20 07:08:36 +02:00
|
|
|
|
|
|
|
printf "Distribution: $DISTROID\nRelease: $DISTROREL\nMode: $DARKMANGET\n"
|
2024-07-20 07:24:40 +02:00
|
|
|
|
2024-07-22 13:55:52 +02:00
|
|
|
if [[ "$DARKMANGET" -eq "dark" ]]; then
|
2024-07-20 07:39:12 +02:00
|
|
|
(notify-send --app-name="darkman" --urgency=low --icon=weather-clear-night "Teema: $DARKMANGET" &)
|
2024-07-22 13:55:52 +02:00
|
|
|
elif [[ "$DARKMANGET" -eq "light" ]]; then
|
2024-07-20 07:39:12 +02:00
|
|
|
(notify-send --app-name="darkman" --urgency=low --icon=weather-clear "Teema: $DARKMANGET" &)
|
|
|
|
else
|
2024-07-22 10:39:29 +02:00
|
|
|
ERRORMESSAGE="Something went wrong?"
|
2024-07-22 13:55:52 +02:00
|
|
|
echo "$ERRORMESSAGE"
|
|
|
|
notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE"
|
2024-07-22 10:39:29 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$QT_STYLE_OVERRIDE" != "kvantum" ]]; then
|
|
|
|
ERRORMESSAGE="\$QT_STYLE_OVERRIDE is not 'kvantum', Qt theme switching has no effect!"
|
|
|
|
echo $ERRORMESSAGE
|
2024-07-22 13:55:52 +02:00
|
|
|
notify-send --app-name="darkman" --icon=error "$ERRORMESSAGE"
|
2024-07-22 10:39:29 +02:00
|
|
|
exit 0
|
2024-07-20 07:39:12 +02:00
|
|
|
fi
|