From a33235b11bbf1a0e6a9d247c31188e708a630624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=C3=ADn=20K=C5=99=C3=AD=C5=BE?= <15214494+antoninkriz@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:01:57 +0100 Subject: [PATCH] Correctly detect all possible GNOME sessions in screen saver plugin lock feature and in utility.py --- safeeyes/plugins/screensaver/plugin.py | 2 +- safeeyes/utility.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/safeeyes/plugins/screensaver/plugin.py b/safeeyes/plugins/screensaver/plugin.py index 0165b63..e8e5e3b 100644 --- a/safeeyes/plugins/screensaver/plugin.py +++ b/safeeyes/plugins/screensaver/plugin.py @@ -64,7 +64,7 @@ def __lock_screen_command(): return ['mate-screensaver-command', '--lock'] elif desktop_session == 'kde' or 'plasma' in desktop_session or desktop_session.startswith('kubuntu') or os.environ.get('KDE_FULL_SESSION') == 'true': return ['qdbus', 'org.freedesktop.ScreenSaver', '/ScreenSaver', 'Lock'] - elif desktop_session in ['gnome', 'unity', 'budgie-desktop'] or desktop_session.startswith('ubuntu'): + elif desktop_session in ['gnome', 'unity', 'budgie-desktop'] or desktop_session.startswith('ubuntu') or desktop_session.startswith('gnome'): if utility.command_exist('gnome-screensaver-command'): return ['gnome-screensaver-command', '--lock'] # From Gnome 3.8 no gnome-screensaver-command diff --git a/safeeyes/utility.py b/safeeyes/utility.py index e145d4d..f91e62b 100644 --- a/safeeyes/utility.py +++ b/safeeyes/utility.py @@ -287,7 +287,7 @@ def desktop_environment(): env = 'lxde' elif 'plasma' in desktop_session or desktop_session.startswith('kubuntu') or os.environ.get('KDE_FULL_SESSION') == 'true': env = 'kde' - elif os.environ.get('GNOME_DESKTOP_SESSION_ID'): + elif os.environ.get('GNOME_DESKTOP_SESSION_ID') or desktop_session.startswith('gnome'): env = 'gnome' elif desktop_session.startswith('ubuntu'): env = 'unity'