From 2d5e9cf8c7e80571e8c5fee17beea1f086990227 Mon Sep 17 00:00:00 2001 From: Salt Date: Mon, 1 Jan 2018 20:35:57 -0600 Subject: [PATCH] Polybar: Add Arch update module --- .config/polybar/config | 11 ++++++++++- .config/polybar/update-arch.sh | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 .config/polybar/update-arch.sh diff --git a/.config/polybar/config b/.config/polybar/config index 9a82fc75..af19ad2c 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -81,7 +81,7 @@ tray-position = right modules-left = i3 bspwm | temperature-label cpu-label memory-label | xwindow-label 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] inherit = template/bar @@ -403,6 +403,15 @@ label = label-warn =  %temperature% 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] inherit = template/module type = internal/volume diff --git a/.config/polybar/update-arch.sh b/.config/polybar/update-arch.sh new file mode 100755 index 00000000..51dfec94 --- /dev/null +++ b/.config/polybar/update-arch.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +uname -r | grep -q "ARCH" || exit +CHECKUPDATES_DB=/tmp/$(uuidgen)/ +numupdates=$(checkupdates | wc -l) +echo $numupdates