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
|
longpresstimer = None
|
||||||
|
|
||||||
inhibit = ['systemd-inhibit',
|
systemd-inhibit = ['systemd-inhibit',
|
||||||
'--what=handle-power-key:handle-suspend-key:handle-hibernate-key',
|
'--what=handle-power-key:handle-suspend-key:handle-hibernate-key',
|
||||||
'sleep',
|
'sleep',
|
||||||
'infinity']
|
'infinity']
|
||||||
|
|
||||||
def inhibit():
|
def inhibit():
|
||||||
for proc in psutil.process_iter():
|
for proc in psutil.process_iter():
|
||||||
if inhibit == proc.cmdline():
|
if systemd-inhibit == proc.cmdline():
|
||||||
return
|
return
|
||||||
|
|
||||||
print ( "Starting inhibitor" )
|
print ( "Starting inhibitor" )
|
||||||
with daemon.DaemonContext():
|
with daemon.DaemonContext():
|
||||||
subprocess.call(inhibit)
|
subprocess.call(systemd-inhibit)
|
||||||
|
|
||||||
def uninhibit():
|
def uninhibit():
|
||||||
print ( "Stopping inhibitor" )
|
print ( "Stopping inhibitor" )
|
||||||
subprocess.call(['pkill', '-f', ' '.join(inhibit)])
|
subprocess.call(['pkill', '-f', ' '.join(systemd-inhibit)])
|
||||||
|
|
||||||
def longpress():
|
def longpress():
|
||||||
os.system( "~/.steam/root/ubuntu12_32/steam -ifrunning steam://longpowerpress" )
|
os.system( "~/.steam/root/ubuntu12_32/steam -ifrunning steam://longpowerpress" )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user