1
0
mirror of https://github.com/eoli3n/dotfiles synced 2024-11-22 23:12:32 +01:00

added systemd module to waybar

This commit is contained in:
eoli3n 2020-05-14 22:35:34 +02:00
parent 711721fea9
commit 4a079a1c3f
3 changed files with 21 additions and 5 deletions

@ -74,7 +74,7 @@
"modules-left": ["tray", "custom/spotify"],
"modules-center": ["network#speed"],
"modules-right": ["custom/backup", "custom/zfs-trim", "custom/zfs-scrub", "temperature", "custom/storage", "cpu", "memory" ],
"modules-right": ["custom/systemd", "custom/backup", "custom/zfs-trim", "custom/zfs-scrub", "temperature", "custom/storage", "cpu", "memory" ],
"custom/spotify": {
"format": "<span foreground='#929292'></span> {}",
"interval": 1,
@ -116,6 +116,12 @@
"exec": "echo a",
"exec-if": "systemctl is-active --quiet backup"
},
"custom/systemd": {
"format": "<span foreground='#ff5c57'> {}</span>",
"interval": 5,
"exec": "~/.config/waybar/modules/systemd.sh",
"exec-if": "~/.config/waybar/modules/systemd.sh"
},
"cpu": {
"interval": 3,
"format": "<span foreground='#929292'></span> {usage}%"

@ -0,0 +1,10 @@
#!/bin/bash
if ! systemctl is-system-running | grep running
then
echo $(systemctl is-system-running) $(systemctl list-units --failed --plain --no-legend --full | wc -l)
exit 0
else
exit 1
fi

@ -54,7 +54,7 @@ window {
color: @alert;
}
#mode, #battery, #cpu, #memory, #network, #pulseaudio, #backlight, #custom-backup, #custom-pkg, #custom-storage, #custom-vpn, #custom-zfs-trim, #custom-zfs-scrub, #temperature, #clock {
#mode, #battery, #cpu, #memory, #network, #pulseaudio, #backlight, #custom-backup, #custom-pkg, #custom-storage, #custom-vpn, #custom-zfs-trim, #custom-zfs-scrub, #custom-systemd, #temperature, #clock {
margin: 0px 16px 0px 0px;
}