smartpause: use swayidle on all non-gnome wayland sessions

This commit is contained in:
Mel Dafert 2023-12-12 13:06:46 +01:00
parent 777d48603d
commit a5a7185065
No known key found for this signature in database
GPG Key ID: AA7788690248DAB3
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ def validate(plugin_config, plugin_settings):
command = None
if utility.DESKTOP_ENVIRONMENT == "gnome" and utility.IS_WAYLAND:
command = "dbus-send"
elif utility.DESKTOP_ENVIRONMENT == "sway":
elif utility.IS_WAYLAND:
command = "swayidle"
else:
command = "xprintidle"

View File

@ -174,7 +174,7 @@ def init(ctx, safeeyes_config, plugin_config):
long_break_duration = safeeyes_config.get('long_break_duration')
waiting_time = min(2, idle_time) # If idle time is 1 sec, wait only 1 sec
is_wayland_and_gnome = context['desktop'] == 'gnome' and context['is_wayland']
use_swayidle = context['desktop'] == 'sway'
use_swayidle = context['desktop'] != 'gnome' and context['is_wayland']
def __start_idle_monitor():