Skip to content

Commit 786e066

Browse files
committed
screensaver: some types
1 parent a5170c7 commit 786e066

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

safeeyes/plugins/screensaver/plugin.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import logging
2424
import os
25+
import typing
2526

2627
from safeeyes import utility
2728
from safeeyes.model import TrayAction
@@ -36,7 +37,7 @@
3637
icon_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

0 commit comments

Comments
 (0)