summaryrefslogtreecommitdiff
path: root/i3/.config/i3blocks/bin/updates
diff options
context:
space:
mode:
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