From 6a8b29a87baa53aca2ccc3e280079d04c2b2bf39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Fri, 25 Aug 2017 18:00:07 -0400 Subject: [PATCH] xscreensaver support this should work on non-standard desktop environments (e.g. mine is Xmonad) by detecting if the daemon is running when the command exists obviously, if a user is running a xscreensaver in a standard DE, that won't work, but that should be uncommon enough to not cause problems --- safeeyes/Utility.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/safeeyes/Utility.py b/safeeyes/Utility.py index c6388b5..d9845a3 100644 --- a/safeeyes/Utility.py +++ b/safeeyes/Utility.py @@ -326,6 +326,9 @@ def lock_screen_command(): if 'deprecated' not in os.environ.get('GNOME_DESKTOP_SESSION_ID') and command_exist('gnome-screensaver-command'): # Gnome 2 return ['gnome-screensaver-command', '--lock'] + elif command_exist('xscreensaver-command'): + # this will fail if the daemon is not running + return os.system('xscreensaver-command -version > /dev/null') == 0 return None