Skip to content

Instantly share code, notes, and snippets.

@NicolaSmaniotto
Created February 17, 2018 16:47
Show Gist options
  • Save NicolaSmaniotto/9bb98b04c0a9e5951a3ed7fc303f878e to your computer and use it in GitHub Desktop.
Save NicolaSmaniotto/9bb98b04c0a9e5951a3ed7fc303f878e to your computer and use it in GitHub Desktop.
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" &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment