Skip to content

Commit

Permalink
Fix COLOR_SCHEME when commands exit with error
Browse files Browse the repository at this point in the history
Fix #57
  • Loading branch information
TheTumultuousUnicornOfDarkness committed Oct 1, 2023
1 parent 0a983ad commit 7468fac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions linuxdeploy-plugin-gtk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ mkdir -p "$HOOKSDIR"
cat > "$HOOKFILE" <<\EOF
#! /usr/bin/env bash
COLOR_SCHEME="$(dbus-send --session --dest=org.freedesktop.portal.Desktop --type=method_call --print-reply --reply-timeout=1000 /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read 'string:org.freedesktop.appearance' 'string:color-scheme' 2>/dev/null | tail -n1 | cut -b35- | cut -d' ' -f2)"
COLOR_SCHEME="$(dbus-send --session --dest=org.freedesktop.portal.Desktop --type=method_call --print-reply --reply-timeout=1000 /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read 'string:org.freedesktop.appearance' 'string:color-scheme' 2> /dev/null | tail -n1 | cut -b35- | cut -d' ' -f2 || echo)"
if [ -z "$COLOR_SCHEME" ]; then
COLOR_SCHEME="$(gsettings get org.gnome.desktop.interface color-scheme 2> /dev/null)"
COLOR_SCHEME="$(gsettings get org.gnome.desktop.interface color-scheme 2> /dev/null || echo)"
fi
case "$COLOR_SCHEME" in
"1"|"'prefer-dark'") GTK_THEME_VARIANT="dark";;
Expand Down

0 comments on commit 7468fac

Please sign in to comment.