mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-02-03 17:53:58 +00:00
Merge pull request #76 from ublue-os/rename-inhibit
fix(power-button-handler): Rename 'inhibit' string to 'systemd-inhibit'
This commit is contained in:
commit
d5418f5ed0
@ -19,23 +19,23 @@ for device in devices:
|
||||
|
||||
longpresstimer = None
|
||||
|
||||
inhibit = ['systemd-inhibit',
|
||||
systemd-inhibit = ['systemd-inhibit',
|
||||
'--what=handle-power-key:handle-suspend-key:handle-hibernate-key',
|
||||
'sleep',
|
||||
'infinity']
|
||||
|
||||
def inhibit():
|
||||
for proc in psutil.process_iter():
|
||||
if inhibit == proc.cmdline():
|
||||
if systemd-inhibit == proc.cmdline():
|
||||
return
|
||||
|
||||
print ( "Starting inhibitor" )
|
||||
with daemon.DaemonContext():
|
||||
subprocess.call(inhibit)
|
||||
subprocess.call(systemd-inhibit)
|
||||
|
||||
def uninhibit():
|
||||
print ( "Stopping inhibitor" )
|
||||
subprocess.call(['pkill', '-f', ' '.join(inhibit)])
|
||||
subprocess.call(['pkill', '-f', ' '.join(systemd-inhibit)])
|
||||
|
||||
def longpress():
|
||||
os.system( "~/.steam/root/ubuntu12_32/steam -ifrunning steam://longpowerpress" )
|
||||
|
Loading…
x
Reference in New Issue
Block a user