Removed obelisk status, added mail status check.
This commit is contained in:
parent
46f8c3c8ea
commit
02d29e0f76
@ -103,7 +103,7 @@ bottom = false
|
||||
;border-right-size = 16
|
||||
;unused modules - mpd xbacklight backlight-acpi alsa
|
||||
modules-left = i3
|
||||
modules-center = temperature battery xkeyboard memory cpu filesystem updates-arch reboot-check xbacklight top-process obelisk-status
|
||||
modules-center = temperature battery xkeyboard memory cpu filesystem updates-arch reboot-check xbacklight top-process mail-status
|
||||
modules-right = net wifi0 vpn powermenu
|
||||
|
||||
; TRAY MANAGEMENT
|
||||
@ -159,6 +159,12 @@ exec = ~/scripts/obelisk.status.sh
|
||||
tail = false
|
||||
interval = 10
|
||||
|
||||
[module/mail-status]
|
||||
type = custom/script
|
||||
exec = ~/scripts/mail.status.sh
|
||||
tail = false
|
||||
interval = 10
|
||||
|
||||
[module/top-process]
|
||||
type = custom/script
|
||||
format-prefix = " "
|
||||
|
||||
26
scripts/executable_mail.status.sh
Normal file
26
scripts/executable_mail.status.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
STATUSURL=https://mail.nielandt.be
|
||||
STATUS=$(curl -s -I $STATUSURL 2>/dev/null | head -n 1 | cut -d$' ' -f2)
|
||||
|
||||
# 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
|
||||
# could have failed completely (network down etc)
|
||||
# -z tests for empty string
|
||||
if [ -z $STATUS ]; then
|
||||
echo "%{F$FAILED} %{F-}"
|
||||
# expected statuses, healthy, degraded, failed
|
||||
elif [ $STATUS = "200" ]; then
|
||||
echo "%{F$HEALTHY} %{F-}"
|
||||
#elif [ $STATUS = "degraded" ]; then
|
||||
# echo "%{F$DEGRADED} %{F-}"
|
||||
#elif [ $STATUS = "failed" ]; then
|
||||
# echo "%{F$FAILED} %{F-}"
|
||||
else
|
||||
echo "%{F$FAILED} %{F-}"
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user