Skip to content

Instantly share code, notes, and snippets.

View NicolaSmaniotto's full-sized avatar

Nicola Smaniotto NicolaSmaniotto

View GitHub Profile
@NicolaSmaniotto
NicolaSmaniotto / gist:9bb98b04c0a9e5951a3ed7fc303f878e
Created February 17, 2018 16:47
Available updates polybar module
[module/updates]
type = custom/script
interval = 10
format = <label>
format-prefix = " "
format-foreground = ${colors.color0}
format-background = ${colors.color4}
exec = cat updates.txt | wc -l
click-left = notify-send "$(if [ $(cat updates.txt | wc -l) != 0 ]; then echo 'Available updates ('$(cat updates.txt | wc -l)'):'; else echo 'Everything up to date!'; fi)" "$(cat updates.txt | egrep -o '^[^\ ]+')"
click-right = urxvt -e zsh -c "sleep 0.2s; i3-msg floating enabled; clear; pacaur -Syu; checkupdates > updates.txt" &