this post was submitted on 29 Mar 2024
42 points (97.7% liked)

Arch Linux

7175 readers
9 users here now

The beloved lightweight distro

founded 4 years ago
MODERATORS
 

I find that I habitually open a terminal and run an update on every boot of my system (which gets rebooted once a day). I'm curious what other people do.

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 4 points 7 months ago (1 children)

Literally just

#!/bin/sh

if checkupdates || yay -Qu; then
    notify-send "Package updates available" "To update, press MOD + SHIFT + U" -i "update-catppuccin-mocha"
fi

mod+shift+u was bound to spawn a terminal window running yay -Syu, obviously change the notification to say whatever you want. The icon is a custom icon, replace it with whatever icon you want for the notification or just remove the icon if you don't want one.

I've since moved to Artix so the test is now just yay -Qu as checkupdates doesn't seem to exist on Artix, but if you're on base Arch and use yay, the above should work. You can also remove the yay if you don't use yay and I think that just checks for updates from official arch repos, not from aur. (yay -Qu should check both but I have both commands in the script just in case)

[โ€“] [email protected] 2 points 7 months ago* (last edited 7 months ago)

This is so cool! Very clever solution to this issue. Thank you for sharing! ๐Ÿ˜Š An interesting thing that I ran into when testing it was regarding the difference between [pacman|yay|paru] -Qu and checkupdates: checkupdates showed that an update was available, but the -Qu option did not reveal the update. It wasn't until I synced the database with -Sy that -Qu started showing the updates.

Update (2024-03-31T03:20Z): Ah, it looks like checkupdates essentially is just running pacman -Sy and pacman -Qu.