Commit 7604b19b authored by Roman Alifanov's avatar Roman Alifanov

double-trigger check when using de gnome replaced with a 150 millisecond ignore (eterbug 17898)

parent a9897544
...@@ -113,25 +113,20 @@ main() { ...@@ -113,25 +113,20 @@ main() {
;; ;;
esac esac
if [ "$GNOME_DE" = True ] ; then
local COUNT=0
fi
dbus-monitor "interface='org.freedesktop.portal.Settings',member=SettingChanged" | \ dbus-monitor "interface='org.freedesktop.portal.Settings',member=SettingChanged" | \
while IFS= read -r LINE; do while IFS= read -r LINE; do
local THEME local THEME
local CURRENT_TIME
local LAST_UPDATE
THEME=$(echo "$LINE" | grep -E -o 'string "(prefer-dark|default)"') THEME=$(echo "$LINE" | grep -E -o 'string "(prefer-dark|default)"')
if [ -n "$THEME" ]; then if [ -n "$THEME" ]; then
# Текущее время в миллисекундах
CURRENT_TIME=$(date +%s%3N)
if [ "$GNOME_DE" = True ] ; then if [ -z "$LAST_UPDATE" ] || [ $((CURRENT_TIME - LAST_UPDATE)) -ge 150 ]; then
((COUNT++)) LAST_UPDATE=$CURRENT_TIME
if [ $(($COUNT % 2)) = 0 ]; then
echo "$THEME"
check_and_update_themes
COUNT=0
fi
else
echo "$THEME" echo "$THEME"
check_and_update_themes check_and_update_themes
fi fi
......
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