Call subprocess to lock screen

This commit is contained in:
2024-12-03 11:31:00 -07:00
parent 99699f5867
commit a683f9d976
+15
View File
@@ -0,0 +1,15 @@
import os, logging
DEBUG = os.environ.get('DEBUG')
logging.basicConfig(
format='[%(asctime)s] %(levelname)s %(module)s/%(funcName)s - %(message)s',
level=logging.DEBUG if DEBUG else logging.INFO)
import subprocess
def lock_screen():
subprocess.run(['xdg-screensaver', 'lock'])
if __name__ == '__main__':
lock_screen()