Compare commits

..

2 Commits

2 changed files with 33 additions and 1 deletions

View File

@ -103,7 +103,7 @@ bottom = false
;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-pacman 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 modules-right = net wifi0 vpn powermenu
; TRAY MANAGEMENT ; TRAY MANAGEMENT
@ -159,6 +159,12 @@ exec = ~/scripts/obelisk.status.sh
tail = false tail = false
interval = 10 interval = 10
[module/mail-status]
type = custom/script
exec = ~/scripts/mail.status.sh
tail = false
interval = 10
[module/top-process] [module/top-process]
type = custom/script type = custom/script
format-prefix = " " format-prefix = " "

View 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