Call subprocess to lock screen
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user