This commit is contained in:
2025-08-03 13:16:51 +02:00
parent 2670f63d20
commit 28441df095
9 changed files with 116 additions and 9 deletions

View File

@ -11,6 +11,7 @@
],
"modules-right": [
"privacy",
"custom/coffee",
"pulseaudio",
"cpu",
"memory",
@ -23,6 +24,13 @@
"tooltip": false,
"on-click": "hyprctl dispatch exec 'wlogout -b 6 -L 1100 -R 1100 -T 650 -B 650'"
},
"custom/coffee": {
"exec": "/usr/bin/python3 /home/paul/.config/waybar/scripts/coffee.py",
"format": "{}",
"return-type": "json",
"interval": 1,
"on-click": "pidof hypridle >/dev/null && killall hypridle || hyprctl dispatch exec hypridle"
},
"hyprland/workspaces": {
"format": "{name}",
"tooltip": false,

View 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"
}))

View File

@ -102,5 +102,12 @@ window#waybar {
padding-left: 5px;
}
#custom-coffee {
padding-right: 5px;
}
.inactive {
opacity: 0.5;
}