aboutsummaryrefslogtreecommitdiff
path: root/dotfiles
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2026-11-11 19:47:52 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2026-11-11 19:47:52 +0300
commitda24f0ab7630c3a26381a4bdf1534169b88cb354 (patch)
tree4bb164f8393145ed6f279dec2d8a231a082175b9 /dotfiles
parentdb1c45b344e02b0f4b89e15355a183d02c8f43e5 (diff)
downloadswayrice-da24f0ab7630c3a26381a4bdf1534169b88cb354.tar.gz
swayrice-da24f0ab7630c3a26381a4bdf1534169b88cb354.zip
mailsync, pacsync: update notificationsniri
Use icons, be transient, etc.
Diffstat (limited to 'dotfiles')
-rwxr-xr-xdotfiles/.local/bin/mailsync2
-rwxr-xr-xdotfiles/.local/bin/pacsync14
2 files changed, 10 insertions, 6 deletions
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