16 lines
347 B
Python
16 lines
347 B
Python
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()
|