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() {
;;
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
local CURRENT_TIME
local LAST_UPDATE
THEME=$(echo "$LINE" | grep -E -o 'string "(prefer-dark|default)"')
if [ -n "$THEME" ]; then
# Текущее время в миллисекундах
CURRENT_TIME=$(date +%s%3N)
if [ "$GNOME_DE" = True ] ; then
((COUNT++))
if [ $(($COUNT % 2)) = 0 ]; then
echo "$THEME"
check_and_update_themes
COUNT=0
fi
else
if [ -z "$LAST_UPDATE" ] || [ $((CURRENT_TIME - LAST_UPDATE)) -ge 150 ]; then
LAST_UPDATE=$CURRENT_TIME
echo "$THEME"
check_and_update_themes
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