diff --git a/qubesidle/idleness_monitor.py b/qubesidle/idleness_monitor.py index b1ec1ee..73476b9 100644 --- a/qubesidle/idleness_monitor.py +++ b/qubesidle/idleness_monitor.py @@ -118,7 +118,10 @@ def main(): asyncio.run(monitor.monitor_idleness()) - subprocess.call(['sudo', 'poweroff']) + try: + subprocess.run(['systemctl', 'poweroff'], check=True) + except subprocess.CalledProcessError: + subprocess.run(['sudo', 'poweroff']) if __name__ == '__main__':