Arch Updates Informer

Just found a plasmoid for KDE Plasma. It checks for updates and informs you. )

The funny thing is it works! ) It checks for updates every hour, it can check for updates right after the system start, and if you click the middle mouse button, it updates the system. ) Funny. It lives in a system tray.
What I cannot do is - I cannot update the system by clicking a mouse button. I have to use yay in a regular way. But it checks and it informs. )

2 Likes

Cool this isnā€™t something I would use but Iā€™m sure there are some other users who might find it good for them. :wink:

1 Like

Have you set it on how to handle updates? Thereā€™s a choice between yay & paru in its settings.

A quick bash script that does this. There is no need to install additional apps to your system for things like this. But it is your system, so your rules and needs are what matter.


#!/bin/bash

# Function to check for updates and send notification
check_updates() {
    updates=$(checkupdates && paru -Qua)

    if [ -n "$updates" ]; then
        notify-send -t 60000 -a "System Updates" "Updates Available" "Click to update in your terminal" -A "Update"

        if [ $? -eq 0 ]; then
            # Notification was clicked, launch alacritty and run pacman and yay
            alacritty -H -e "bash -c 'sudo pacman -Syu && yay -Sua; echo; read -p \"Press Enter to close this window...\"'"
        fi
    fi
}

# Main loop
while true; do
    check_updates
    sleep 6h
done

This script does the following:

  1. It defines a function called check_updates that:
  • Runs checkupdates && paru -Qua to check for both official repository and AUR updates
  • If updates are found, it sends a notification using notify-send that lasts for 60 seconds (60000 milliseconds)* .
  • If the notification is clicked, it launches the Alacritty terminal and runs sudo pacman -Syu && yay -Sua*.
  • The main loop runs the check_updates function and then sleeps for 6 hours before repeating

To use this script:

  1. Save it to a file, for example update_checker.sh.
  2. Make it executable with chmod +x update_checker.sh.
  3. Run it in the background with ./update_checker.sh &.

Note that this script assumes:

  • You have checkupdates, paru, notify-send, alacritty, and yay installed on your system.
  • Youā€™re using Alacritty as your terminal. If you prefer a different terminal, replace alacritty with your preferred terminal command.

To make this script run automatically at startup, you can add it to your window managerā€™s autostart configuration or create a systemd user service. Remember that running automatic update checks and notifications can be resource-intensive, so adjust the frequency as needed for your system.

2 Likes

I still question the need for an update notifier in a rolling release distro. There are updates all the time! :wink: :rofl:

6 Likes

There are those who come from OSā€™s that make them dependant on those things. I have a silent notifier in a conky but its more or less to keep up with the number of updates I know what a normal week looks like and if there is an influx in that number i will check to see what all is being upgraded (usually a large package like python) then I will break my normal update cycle and update or hold off depending on the information I get about said updates. I especially want to break my weekly cycle if its a Security Update. Other than that is just a look

4 Likes

Quite right so! For me, Apdatifier 's only & sole use, is limited to just these 2 purposes:

  1. Notifying & updating the few widgets I have installed &
  2. Keeping me free from bothering to look if there have been any updates to them (widgets) available.
    Gosh, sometimes it gets almost impossible to get them updated. And I considered that Apdatifier was a far better choice than installing & configuring the whole of KDEā€™s Discover just for this task. :wink:
2 Likes

Perhaps (!) the idea is to know WHICH updates are awaiting - then you can choose whether to run them NOW or notā€¦ :grin:

I run a Conky including a smooth scrolling list of all pending updates (pacman and AUR separated) so I can look whenever I feel like it - without an obtrusive notification popping up. Just go with your own preferred setupā€¦

1 Like

THANK YOU!
Itā€™s a great addition to my knowledge base. )
I appreciate your input very much!
Best wishes!

Youā€™re welcome. Glad I could help. :enos_flag: :vulcan_salute:

Iā€™ve been using this for a while now after the last time I decided to redo my desktopā€™s plugins and widgets layouts, I have to say I quite like it.

As echoed above, there are many ways to get this kind of information and whether or not it adds value for you is entirely down to how you like to use your system, so a lot of choice is never a bad thing!

To touch on this:

I believe the plugin defaults to assuming youā€™re using a specific terminal as I remember having to do this myself since it wasnā€™t the one I use, all you need to do to enable that update button to actually work is right click the widget and go into the configuration menu for it, drop into the ā€œUpgradeā€ tab and change the ā€˜terminalā€™ dropdown to whatever your installed terminal is. I believe the default for EOS is konsole so youā€™ll probably have that in there if you havenā€™t replaced it :slightly_smiling_face:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.