From da24f0ab7630c3a26381a4bdf1534169b88cb354 Mon Sep 17 00:00:00 2001 From: Yaroslav de la Peña Smirnov Date: Wed, 11 Nov 2026 19:47:52 +0300 Subject: mailsync, pacsync: update notifications Use icons, be transient, etc. --- dotfiles/.local/bin/mailsync | 2 +- dotfiles/.local/bin/pacsync | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'dotfiles/.local') diff --git a/dotfiles/.local/bin/mailsync b/dotfiles/.local/bin/mailsync index 42b8079..ad69337 100755 --- a/dotfiles/.local/bin/mailsync +++ b/dotfiles/.local/bin/mailsync @@ -33,7 +33,7 @@ do account="$(echo "$mailbox" | sed "s/.*\///")" newcount=$(find "$HOME/.local/share/mail/$account/INBOX/new/" "$HOME/.local/share/mail/$account/Inbox/new/" "$HOME/.local/share/mail/$account/inbox/new/" -type f -newer "$HOME/.cache/lastmailsync" 2> /dev/null | wc -l) if [ "$newcount" -gt "0" ]; then - notify-send "📬 Email" "$newcount new mail(s) in \`$account\` mailbox." + notify-send -a "E-mail" -i mail-client "$newcount new mail(s) in \`$account\` mailbox." thereis=1 fi done diff --git a/dotfiles/.local/bin/pacsync b/dotfiles/.local/bin/pacsync index 2e5d60f..15f2c97 100755 --- a/dotfiles/.local/bin/pacsync +++ b/dotfiles/.local/bin/pacsync @@ -8,6 +8,9 @@ if pidof pacman; then exit fi +napp="System upgrade" +ni="preferences-system-linux" + # Check several times before giving up, useful when just waking up from sleep # since internet is usually not available right away wget -q --tries=5 --timeout=20 --spider 1.1.1.1 > /dev/null || exit @@ -15,19 +18,20 @@ wget -q --tries=5 --timeout=20 --spider 1.1.1.1 > /dev/null || exit # Source the needed env variables so that it can function properly from cron . ~/.cache/sessionenv -notify-send " System upgrade" "Syncing repositories and downloading packages..." +notify-send -a "$napp" -i "$ni" -e "Syncing repositories and downloading packages..." touch ~/.cache/pacsynclive killall -41 waybar -sudo pacman -Syuw --noconfirm || notify-send " System upgrade" \ - "Error downloading updates. Check your internet connection or that you have the required permissions" +if ! sudo pacman -Syuw --noconfirm; then + notify-send -a "$napp" -i "$ni" -u critical -t 3000 "Error downloading updates. +fi rm -f ~/.cache/pacsynclive killall -41 waybar upno=$(pacman -Qu | wc -l) -if [ $upno -lt 0 ]; then - notify-send " System upgrade" "Repository sync finished. $upno updates are available" +if [ $upno -gt 0 ]; then + notify-send -a "$napp" -i "$ni" "Repository sync finished. $upno updates are available" fi -- cgit v1.3.1