diff --git a/src/bridge/Greeter.py b/src/bridge/Greeter.py index c5364b7..3ff27b1 100644 --- a/src/bridge/Greeter.py +++ b/src/bridge/Greeter.py @@ -108,6 +108,10 @@ class Greeter(BridgeObject): self._connect_signals() self._determine_shared_data_directory_path() + + if LightDMGreeter.get_lock_hint(): + screensaver.force_screensaver(True) + logger.debug("LightDM API connected") def _determine_shared_data_directory_path(self): diff --git a/src/utils/screensaver.py b/src/utils/screensaver.py index ac713e9..0165599 100644 --- a/src/utils/screensaver.py +++ b/src/utils/screensaver.py @@ -1,3 +1,4 @@ +from Xlib import X from Xlib.display import Display from Xlib.error import DisplayError from logger import logger @@ -52,4 +53,8 @@ class Screensaver: self.saved = False logger.debug("Screensaver reset") + def force_screensaver(self, value: bool): + """Force screensaver""" + self.display.force_screen_saver(X.ScreenSaverActive if value else X.ScreenSaverReset) + screensaver = Screensaver()