Skip to content

Instantly share code, notes, and snippets.

@nwg-piotr
Last active May 31, 2018 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nwg-piotr/8691fa9cb7211908f44f98c0c2463196 to your computer and use it in GitHub Desktop.
Save nwg-piotr/8691fa9cb7211908f44f98c0c2463196 to your computer and use it in GitHub Desktop.
This is to add Arch Linux updates notification to your tint2 panel. Download the bash scipt and icon from https://drive.google.com/open?id=1aW7C23aUQSkcfP5RRh4hC5SEAlta26-T and unpack to your home folder. Finally add the tint2rc Executor to your ~/.config/tint2/tint2rc file. Replace `xfce4-terminal` with your favorite terminal name.
#!/bin/bash
# How to modify to use various AUR helpers:
# EITHER check regular repos, then AUR with trizen:
upd=$(/bin/sh -c "/usr/bin/checkupdates && /usr/bin/trizen -Qqu -a")
# or with yaourt:
#upd=$(/bin/sh -c "(/usr/bin/checkupdates; /usr/bin/yaourt -Qu -a | cut -c 5-) | sort -u -t' ' -k1,1")
# or pacaur:
#upd=$(/bin/sh -c "/usr/bin/checkupdates && /usr/bin/pacaur -Qqu -a")
# or aurman:
#upd=$(/bin/sh -c "/usr/bin/checkupdates && /usr/bin/aurman -Qqu")
# or yay:
#upd=$(/bin/sh -c "/usr/bin/checkupdates && /usr/bin/yay -Qqu --color never | sed 's/Get .*//'")
# OR just check regular repos only:
#upd=$(/usr/bin/checkupdates)
# DO NOT FORGET to change the update line in the Executor accordingly
# SEE: https://github.com/RaphaelRochet/arch-update/wiki
if [ ! -z "$upd" ]
then
echo ~/.ob-arch-checker/archlinux-icon-au.svg
notify-send "Pending updates:" "<i>$upd</i>" --icon="archlinux" --expire-time=5000
fi
#-------------------------------------
# Executor 1
execp = new
execp_command = ~/.ob-arch-checker/./au.sh
execp_interval = 900
execp_has_icon = 1
execp_cache_icon = 0
execp_continuous = 0
execp_markup = 0
execp_tooltip =
execp_lclick_command = xfce4-terminal -e 'sh -c "trizen -Syyu ; echo Done - press enter to exit; read; killall -SIGUSR1 tint2"'
execp_rclick_command =
execp_mclick_command =
execp_uwheel_command =
execp_dwheel_command =
execp_font_color = #f8e6e6 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 26
execp_icon_h = 26
@nwg-piotr
Copy link
Author

If you'd like tu use something else instead of Trizen, you'll find alternatives here: https://github.com/RaphaelRochet/arch-update/wiki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment