Compare commits

...

2 commits

4 changed files with 31 additions and 4 deletions

View file

@ -99,7 +99,7 @@ hosts = ['portalo']
group = '' group = ''
[apps.teamspeak] [apps.teamspeak]
command = 'flatpak run com.teamspeak.TeamSpeak -nosingleinstance' command = 'flatpak run com.teamspeak.TeamSpeak3 -nosingleinstance'
hosts = [] hosts = []
group = 'chat' group = 'chat'

View file

@ -14,6 +14,7 @@
"cpu", "cpu",
"memory", "memory",
"custom/pacman", "custom/pacman",
"custom/status",
"custom/weather", "custom/weather",
"clock", "clock",
"tray" "tray"
@ -32,7 +33,7 @@
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>" "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
}, },
"cpu": { "cpu": {
"format": " {usage}%" "format": " {usage}%"
}, },
"memory": { "memory": {
"format": " {percentage}%" "format": " {percentage}%"
@ -47,7 +48,7 @@
"spacing": 4 "spacing": 4
}, },
"custom/pacman": { "custom/pacman": {
"format": " {}", "format": "󰏕 {}",
"interval": 3600, "interval": 3600,
"exec": "~/.config/waybar/custom/pacman", "exec": "~/.config/waybar/custom/pacman",
"on-click": "alacritty -e 'archlinux-update'", "on-click": "alacritty -e 'archlinux-update'",
@ -61,5 +62,13 @@
"format": "{}", "format": "{}",
"tooltip": true, "tooltip": true,
"interval": 1200 "interval": 1200
},
"custom/status": {
"format": "󱖫 {}",
"exec": "~/.config/waybar/custom/status-serguzim-net",
"on-click": "xdg-open 'https://status.serguzim.net'",
"return-type": "json",
"tooltip": true,
"interval": 500
} }
} }

View file

@ -0,0 +1,14 @@
#!/usr/bin/env sh
result=$(curl https://status.serguzim.net/api/status-page/heartbeat/serguzim-net \
| jq '.heartbeatList | to_entries | map(.value | last .status)
| [group_by(.)[] | {value: .[0], count: length}] | map({(.value|tostring): .count}) | add')
up_count=$(echo "$result" | jq '."1" // 0')
down_count=$(echo "$result" | jq '."0" // 0')
count=$((up_count + down_count))
percent=$((up_count * 100 / count))
tooltip="status.serguzim.net\nUp: $up_count\nDown: $down_count\nTotal: $count\nPercent: $percent%"
echo "{\"text\": \"$percent%\", \"tooltip\": \"$tooltip\"}"

View file

@ -4,7 +4,7 @@
border: none; border: none;
border-radius: 0; border-radius: 0;
font-family: "JetBrains Mono", monospace; font-family: "JetBrainsMono Nerd Font", monospace;
font-size: 10pt; font-size: 10pt;
min-height: 0; min-height: 0;
} }
@ -56,3 +56,7 @@ window#waybar {
#custom-pacman { #custom-pacman {
border-bottom: solid 2px @cyan; border-bottom: solid 2px @cyan;
} }
#custom-status {
border-bottom: solid 2px @orange;
}