File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
safeeyes/plugins/screensaver Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 2222
2323import logging
2424import os
25+ import typing
2526
2627from safeeyes import utility
2728from safeeyes .model import TrayAction
3637icon_lock_later_path = None
3738
3839
39- def __lock_screen_command ():
40+ def __lock_screen_command () -> typing . Optional [ list [ str ]] :
4041 """Function tries to detect the screensaver command based on the current
4142 envinroment.
4243
@@ -94,10 +95,10 @@ def __lock_screen_command():
9495 "/org/gnome/ScreenSaver" ,
9596 "org.gnome.ScreenSaver.Lock" ,
9697 ]
97- elif os .environ .get ("GNOME_DESKTOP_SESSION_ID" ):
98- if "deprecated" not in os . environ . get (
99- "GNOME_DESKTOP_SESSION_ID "
100- ) and utility . command_exist ( "gnome-screensaver-command" ) :
98+ elif gd_session := os .environ .get ("GNOME_DESKTOP_SESSION_ID" ):
99+ if "deprecated" not in gd_session and utility . command_exist (
100+ "gnome-screensaver-command "
101+ ):
101102 # Gnome 2
102103 return ["gnome-screensaver-command" , "--lock" ]
103104 return None
You can’t perform that action at this time.
0 commit comments