summaryrefslogtreecommitdiff
path: root/i3/.config/i3blocks/bin/updates
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2018-02-21 12:18:32 +0000
committerUrbain Vaes <urbain@vaes.uk>2018-02-21 16:46:29 +0000
commitb9ea238dd7e8a56b1d171cdc76e405bb2a8584dd (patch)
treed693deb61965b724cd8630e0a061e5e762341c9c /i3/.config/i3blocks/bin/updates
parent68d822599f074c24505eea2329bfc80e2745feab (diff)
Improve i3 status
Diffstat (limited to 'i3/.config/i3blocks/bin/updates')
-rwxr-xr-xi3/.config/i3blocks/bin/updates13
1 files changed, 13 insertions, 0 deletions
diff --git a/i3/.config/i3blocks/bin/updates b/i3/.config/i3blocks/bin/updates
new file mode 100755
index 0000000..325b485
--- /dev/null
+++ b/i3/.config/i3blocks/bin/updates
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+if command -v checkupdates > /dev/null; then
+ n_updates=$(checkupdates | wc -l)
+ if [[ n_updates -gt 50 ]]; then
+ color='red'
+ elif [[ n_updates -gt 10 ]]; then
+ color='yellow'
+ else
+ color='gray'
+ fi
+ echo "<span color='$color'></span> $n_updates"
+fi