25 lines
617 B
Python
25 lines
617 B
Python
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"
|
|
}))
|
|
|