various
This commit is contained in:
25
.config/waybar/scripts/coffee.py
Normal file
25
.config/waybar/scripts/coffee.py
Normal file
@ -0,0 +1,25 @@
|
||||
from argparse import ArgumentParser
|
||||
from json import dumps
|
||||
from subprocess import run
|
||||
|
||||
COFFEE_ICON = "\ue751"
|
||||
|
||||
if __name__ == "__main__":
|
||||
result = run(["pidof", "hypridle"], capture_output=True, text=True)
|
||||
|
||||
if result.returncode == 0:
|
||||
# Hypridle is running
|
||||
print(dumps({
|
||||
"text": COFFEE_ICON,
|
||||
"tooltip": "Hypridle is running",
|
||||
"class": "inactive"
|
||||
}))
|
||||
|
||||
else:
|
||||
# Hypridle is not running
|
||||
print(dumps({
|
||||
"text": COFFEE_ICON,
|
||||
"tooltip": "Hypridle is not running",
|
||||
"class": "active"
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user