From a5a71850653dc37cfa42936ee3c2a196091d6f74 Mon Sep 17 00:00:00 2001 From: Mel Dafert Date: Tue, 12 Dec 2023 13:06:46 +0100 Subject: [PATCH] smartpause: use swayidle on all non-gnome wayland sessions --- safeeyes/plugins/smartpause/dependency_checker.py | 2 +- safeeyes/plugins/smartpause/plugin.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/safeeyes/plugins/smartpause/dependency_checker.py b/safeeyes/plugins/smartpause/dependency_checker.py index d6526f7..14c6579 100644 --- a/safeeyes/plugins/smartpause/dependency_checker.py +++ b/safeeyes/plugins/smartpause/dependency_checker.py @@ -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" diff --git a/safeeyes/plugins/smartpause/plugin.py b/safeeyes/plugins/smartpause/plugin.py index 242740b..04d4918 100644 --- a/safeeyes/plugins/smartpause/plugin.py +++ b/safeeyes/plugins/smartpause/plugin.py @@ -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():