@@ -370,28 +370,28 @@ def __init__(self):
370
370
name = "caffeine-button" ,
371
371
h_expand = True ,
372
372
child = self .caffeine_box ,
373
- on_clicked = self .toggle_wlinhibit ,
373
+ on_clicked = self .toggle_inhibit ,
374
374
)
375
375
add_hover_cursor (self )
376
376
377
377
self .widgets = [self , self .caffeine_label , self .caffeine_status , self .caffeine_icon ]
378
- self .check_wlinhibit ()
378
+ self .check_inhibit ()
379
379
380
- def toggle_wlinhibit (self , * args , external = False ):
380
+ def toggle_inhibit (self , * args , external = False ):
381
381
"""
382
- Toggle the 'wlinhibit ' process:
382
+ Toggle the 'ax-inhibit ' process:
383
383
- If running, kill it and mark as 'Disabled' (add 'disabled' class).
384
384
- If not running, start it and mark as 'Enabled' (remove 'disabled' class).
385
385
"""
386
386
387
387
try :
388
- subprocess .check_output (["pgrep" , "wlinhibit " ])
389
- exec_shell_command_async ("pkill wlinhibit " )
388
+ subprocess .check_output (["pgrep" , "ax-inhibit " ])
389
+ exec_shell_command_async ("pkill ax-inhibit " )
390
390
self .caffeine_status .set_label ("Disabled" )
391
391
for i in self .widgets :
392
392
i .add_style_class ("disabled" )
393
393
except subprocess .CalledProcessError :
394
- exec_shell_command_async ("wlinhibit " )
394
+ exec_shell_command_async (f"python { data . HOME_DIR } /.config/ { data . APP_NAME_CAP } /scripts/inhibit.py " )
395
395
self .caffeine_status .set_label ("Enabled" )
396
396
for i in self .widgets :
397
397
i .remove_style_class ("disabled" )
@@ -401,9 +401,9 @@ def toggle_wlinhibit(self, *args, external=False):
401
401
message = "Disabled 💤" if self .caffeine_status .get_label () == "Disabled" else "Enabled ☀️"
402
402
exec_shell_command_async (f"notify-send '☕ Caffeine' '{ message } ' -a '{ data .APP_NAME_CAP } ' -e" )
403
403
404
- def check_wlinhibit (self , * args ):
404
+ def check_inhibit (self , * args ):
405
405
try :
406
- subprocess .check_output (["pgrep" , "wlinhibit " ])
406
+ subprocess .check_output (["pgrep" , "ax-inhibit " ])
407
407
self .caffeine_status .set_label ("Enabled" )
408
408
for i in self .widgets :
409
409
i .remove_style_class ("disabled" )
0 commit comments