Browse Source

Added force screensaver on lock

sisyphus
JezerM 3 years ago
parent
commit
7321631106
No known key found for this signature in database
GPG Key ID: 66BBC5D01388C6B5
  1. 4
      src/bridge/Greeter.py
  2. 5
      src/utils/screensaver.py

4
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):

5
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()

Loading…
Cancel
Save