From c514e6042d5f4d74159ae048b17943d5b7df1b9e Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Thu, 17 May 2018 16:27:46 +0100 Subject: [PATCH] Add block to monitor updates on home server --- i3/blocks/homeServerUpdates | 13 +++++++++++++ i3/i3blocks-secondary.conf | 5 +++++ 2 files changed, 18 insertions(+) create mode 100755 i3/blocks/homeServerUpdates diff --git a/i3/blocks/homeServerUpdates b/i3/blocks/homeServerUpdates new file mode 100755 index 00000000..c6c779ef --- /dev/null +++ b/i3/blocks/homeServerUpdates @@ -0,0 +1,13 @@ +#!/usr/bin/sh + +count=$(ssh homeServer checkupdates | wc -l) +if [ "$count" = "0" ]; then + count="" +fi +echo $count +echo $count +if [ "$count" -gt "5" ]; then + echo "#FFOOOO" +else + echo "#FF8000" +fi diff --git a/i3/i3blocks-secondary.conf b/i3/i3blocks-secondary.conf index 83f0ed0d..b6a50d2a 100644 --- a/i3/i3blocks-secondary.conf +++ b/i3/i3blocks-secondary.conf @@ -42,6 +42,11 @@ command=xset -q | grep Caps 2> /dev/null | cut -c23 | sed "s/n/CAPS/" | sed "s/f signal=11 color=#00FF00 +[homeServerUpdates] +interval=300 +command=~/.dotfiles/i3/blocks/homeServerUpdates +label=Home Server Updates + [vps01status] command=~/.dotfiles/i3/blocks/serverStatus VPS01 interval=30