This commit is contained in:
2025-07-09 14:20:11 +02:00
parent a0ade97e52
commit c901996ca0
3 changed files with 25 additions and 20 deletions
+17
View File
@@ -239,6 +239,17 @@ def monitor_stats():
)
def start_hyprlock():
proc = subprocess.run(['pidof', 'hyprloc'])
if proc.returncode != 0:
subprocess.run(['hyprlock'])
def lock_session():
if os.environ.get('HYPR_DISABLE_LOCK', None) is None:
subprocess.run(['loginctl', 'lock-session'])
def main():
if len(sys.argv) < 2:
return
@@ -277,6 +288,12 @@ def main():
elif sys.argv[1] == 'stat':
monitor_stats()
elif sys.argv[1] == 'start-hyprlock':
start_hyprlock()
elif sys.argv[1] == 'lock-session':
lock_session()
else:
print(f'Command not found: {sys.argv[1]}', file=sys.stderr)
sys.exit(1)