A simple Polybar script to display available Arch Linux updates with click actions for notifications and GUI-based package selection.
-
π¦ Update Count β Displays the total number of updates available.
-
π Click Actions (optional):
- Left-click β Show a desktop notification listing update candidates.
- Right-click β Launch a GUI to select which packages to update, then upgrade them via
yay.
-
Required
yayβ AUR helper for Arch Linux
-
Optional (for click actions)
i3wmβ Window manager (used to run scripts)notify-sendβ Desktop notificationszenityβ Graphical package selection dialogtermiteβ Terminal emulator for running updates interactively
-
Clone the repository
git clone https://github.com/yourusername/yay-polybar.git ~/code/yay-polybar cd ~/code/yay-polybar
-
Make scripts executable
chmod +x updates-arch-yay.sh notify-updates.sh prompt-updates.sh
-
Add to Polybar config Insert the following block into your
~/.config/polybar/config.ini:[module/updates] type = custom/script exec = ~/code/yay-polybar/updates-arch-yay.sh interval = 600 click-left = i3-msg exec ~/code/yay-polybar/notify-updates.sh click-right = i3-msg exec ~/code/yay-polybar/prompt-updates.sh
-
Reload Polybar Restart Polybar or reload your config to apply the changes.
-
Left Click β Notify Updates Displays a system notification with the list of available package updates.
-
Right Click β Prompt Updates Opens a
zenitydialog to select packages for updating, then triggers their upgrade viayay.
To display the update terminal as a floating, centered window in i3:
for_window [instance="^package-update$" class="^Termite$"] floating enable, move position centerπ‘ Tip: With Yay Polybar, staying up-to-date on Arch Linux is just a glance and a click away!

