Commit 9a8bd5e2 authored by Roman Alifanov's avatar Roman Alifanov

added detection of desktop environment

parent f3490af4
......@@ -100,19 +100,40 @@ check_and_update_themes
main() {
if check_gsettings_schema; then
echo "reaction mode: after dbus signal"
local COUNT=0
case "$XDG_SESSION_DESKTOP" in
gnome*)
echo "GNOME DETECTED"
local GNOME_DE=True
;;
Hyprland*)
echo "HYPRLAND DETECTED"
;;
*)
;;
esac
if [ "$GNOME_DE" = True ] ; then
local COUNT=0
fi
dbus-monitor "interface='org.freedesktop.portal.Settings',member=SettingChanged" | \
while IFS= read -r LINE; do
local THEME
THEME=$(echo "$LINE" | grep -E -o 'string "(prefer-dark|default)"')
if [ -n "$THEME" ]; then
((COUNT++))
if [ $(($COUNT % 2)) = 0 ]; then
if [ "$GNOME_DE" = True ] ; then
((COUNT++))
if [ $(($COUNT % 2)) = 0 ]; then
echo "$THEME"
check_and_update_themes
COUNT=0
fi
else
echo "$THEME"
check_and_update_themes
COUNT=0
fi
fi
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment