various
This commit is contained in:
@ -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,
|
||||
|
||||
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"
|
||||
}))
|
||||
|
||||
@ -102,5 +102,12 @@ window#waybar {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#custom-coffee {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.inactive {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user