From 2d1c205cefb9646bf9166be3e9f9e93106c23ee0 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Wed, 16 May 2018 16:44:02 +0100 Subject: [PATCH] Add updates block to i3 bar --- i3/blocks/pacmanUpdates | 19 +++++++++++++++++++ i3/i3blocks.conf | 7 ++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 i3/blocks/pacmanUpdates diff --git a/i3/blocks/pacmanUpdates b/i3/blocks/pacmanUpdates new file mode 100755 index 00000000..fdfdb343 --- /dev/null +++ b/i3/blocks/pacmanUpdates @@ -0,0 +1,19 @@ +#!/usr/bin/sh + +if ! command -v checkupdates > /dev/null; then + echo "You need to install checkupdates"; + echo ""; + echo "#FF0000" +else + count=$(checkupdates | wc -l) + if [ "$count" = "0" ]; then + count="" + fi + echo $count + echo $count + if [ "$count" -gt "5" ]; then + echo "#FFOOOO" + else + echo "#FF8000" + fi +fi diff --git a/i3/i3blocks.conf b/i3/i3blocks.conf index 5c48b431..bfa599ec 100644 --- a/i3/i3blocks.conf +++ b/i3/i3blocks.conf @@ -157,9 +157,14 @@ interval=5 [archNews] command=~/.dotfiles/i3/blocks/archNews -interval=3600 +interval=120 color=#FF0000 +[updates] +command=~/.dotfiles/i3/blocks/pacmanUpdates +label=Updates: +interval=120 + # Date Time # [time]