From f17fa4416a98e89440903ae26159caa1ad4ba8d7 Mon Sep 17 00:00:00 2001 From: Joseph Groocock Date: Fri, 1 Apr 2016 18:04:44 +0100 Subject: [PATCH] Add @DomWillams0's update script (thanks pal) Source: https://github.com/DomWilliams0/dotfiles/blob/master/i3blocks/blocks/updates --- .config/i3blocks/blocks/updates | 13 +++++++++++++ .config/i3blocks/config | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100755 .config/i3blocks/blocks/updates diff --git a/.config/i3blocks/blocks/updates b/.config/i3blocks/blocks/updates new file mode 100755 index 0000000..2f58109 --- /dev/null +++ b/.config/i3blocks/blocks/updates @@ -0,0 +1,13 @@ +#!/bin/python2 + +import commands +import os + +button = os.environ.get('BLOCK_BUTTON') +if button == '1': + os.system("i3-sensible-terminal -e 'pacaur -Syu'") + +updates = commands.getstatusoutput("/usr/bin/checkupdates | wc -l")[1] +if updates and updates != '0': + print updates + print updates diff --git a/.config/i3blocks/config b/.config/i3blocks/config index dfdfe69..39e2f31 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -64,6 +64,12 @@ interval=30 [separator] +[updates] +label= +interval=600 + +[separator] + [cpu_usage] label= interval=5