Added obelisk status module
This commit is contained in:
parent
e343db3f5e
commit
f3c10b52d5
@ -100,7 +100,7 @@ monitor = ${env:MONITOR:eDP-1}
|
|||||||
;border-right-size = 16
|
;border-right-size = 16
|
||||||
;unused modules - mpd xbacklight backlight-acpi alsa
|
;unused modules - mpd xbacklight backlight-acpi alsa
|
||||||
modules-left = i3
|
modules-left = i3
|
||||||
modules-center = temperature battery xkeyboard memory cpu filesystem updates-arch reboot-check xbacklight top-process
|
modules-center = temperature battery xkeyboard memory cpu filesystem updates-arch reboot-check xbacklight top-process obelisk-status
|
||||||
modules-right = net wifi0 vpn powermenu
|
modules-right = net wifi0 vpn powermenu
|
||||||
|
|
||||||
; TRAY MANAGEMENT
|
; TRAY MANAGEMENT
|
||||||
@ -150,6 +150,12 @@ format-prefix-foreground = ${colors.bright_green}
|
|||||||
exec = ~/.config/polybar/polybar-scripts/polybar-scripts/info-hackspeed/info-hackspeed.sh
|
exec = ~/.config/polybar/polybar-scripts/polybar-scripts/info-hackspeed/info-hackspeed.sh
|
||||||
tail = true
|
tail = true
|
||||||
|
|
||||||
|
[module/obelisk-status]
|
||||||
|
type = custom/script
|
||||||
|
exec = ~/scripts/obelisk.status.sh
|
||||||
|
tail = false
|
||||||
|
interval = 10
|
||||||
|
|
||||||
[module/top-process]
|
[module/top-process]
|
||||||
type = custom/script
|
type = custom/script
|
||||||
format-prefix = " "
|
format-prefix = " "
|
||||||
|
|||||||
0
scripts/.keep
Normal file
0
scripts/.keep
Normal file
21
scripts/executable_obelisk.status.sh
Normal file
21
scripts/executable_obelisk.status.sh
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
STATUSURL=https://obelisk.ilabt.imec.be/api/v2/status
|
||||||
|
STATUS=$(curl -s $STATUSURL | jq -r '.status')
|
||||||
|
|
||||||
|
# colors
|
||||||
|
HEALTHY="#b8bb26"
|
||||||
|
DEGRADED="#fe8019"
|
||||||
|
FAILED="#fb4934"
|
||||||
|
UNKNOWN="#928374"
|
||||||
|
|
||||||
|
# echo the status in polybar format
|
||||||
|
# the {F}x{F-} syntax allows you to color stuff
|
||||||
|
if [ $STATUS = "healthy" ]; then
|
||||||
|
echo "%{F$HEALTHY} %{F-} obelisk"
|
||||||
|
elif [ $STATUS = "degraded" ]; then
|
||||||
|
echo "%{F$DEGRADED} %{F-} obelisk"
|
||||||
|
elif [ $STATUS = "failed" ]; then
|
||||||
|
echo "%{F$FAILED} %{F-} obelisk"
|
||||||
|
else
|
||||||
|
echo "%{F$UNKNOWN} %{F-} obelisk"
|
||||||
|
fi
|
||||||
Loading…
Reference in New Issue
Block a user