Polybar: Add Arch update module

This commit is contained in:
Salt 2018-01-01 20:35:57 -06:00
parent 60ac9a95d1
commit 2d5e9cf8c7
2 changed files with 15 additions and 1 deletions

View File

@ -81,7 +81,7 @@ tray-position = right
modules-left = i3 bspwm | temperature-label cpu-label memory-label | xwindow-label modules-left = i3 bspwm | temperature-label cpu-label memory-label | xwindow-label
modules-center = modules-center =
modules-right = | xbacklight-label volume-ramp wlan-network eth-network battery-ramp | date modules-right = | update-arch xbacklight-label volume-ramp wlan-network eth-network battery-ramp | date
[bar/gamma] [bar/gamma]
inherit = template/bar inherit = template/bar
@ -403,6 +403,15 @@ label =
label-warn =  %temperature% label-warn =  %temperature%
label-warn-foreground = ${res/colors.alert} label-warn-foreground = ${res/colors.alert}
[module/update-arch]
inherit = template/module
type = custom/script
exec = $HOME/.config/polybar/update-arch.sh
exec-if = wget -q --spider http://www.startpage.com/ && uname -r | grep -q "ARCH"
format-prefix = " "
format-prefix-foreground = ${res/colors.primary-dark}
interval = 3600
[module/volume-ramp] [module/volume-ramp]
inherit = template/module inherit = template/module
type = internal/volume type = internal/volume

5
.config/polybar/update-arch.sh Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
uname -r | grep -q "ARCH" || exit
CHECKUPDATES_DB=/tmp/$(uuidgen)/
numupdates=$(checkupdates | wc -l)
echo $numupdates