Module packages

Module packages 

Source
Expand description

Pending updates for different package manager like apt, pacman, etc.

Currently, these package managers are supported:

  • apk for Alpine Linux
  • apt for Debian/Ubuntu-based systems
  • aur for Arch-based systems
  • brew for the Homebrew Package Manager
  • dnf for Fedora-based systems
  • flatpak for Flatpak packages
  • pacman for Arch-based systems
  • snap for Snap packages
  • xbps for Void Linux

§Configuration

KeyValuesDefault
intervalUpdate interval in seconds.600
package_managerPackage manager to check for updatesAutomatically derived from format templates, but can be used to influence the $total value
formatA string to customise the output of this block. See below for available placeholders." $icon $total.eng(w:1) "
format_singularSame as format, but for when exactly one update is available." $icon $total.eng(w:1) "
format_up_to_dateSame as format, but for when no updates are available." $icon $total.eng(w:1) "
warning_updates_regexDisplay block as warning if updates matching regex are available.None
critical_updates_regexDisplay block as critical if updates matching regex are available.None
ignore_updates_regexDoesn’t include updates matching regex in the count.None
ignore_phased_updatesDoesn’t include potentially held back phased updates in the count. (For Debian/Ubuntu-based systems)false
aur_commandAUR command to check available updates, which outputs in the same format as pacman. E.g. yay -Qua (For Arch-based systems)Required if $aur is used
PlaceholderValueTypeUnit
iconA static iconIcon-
apkNumber of updates available in Alpine LinuxNumber-
aptNumber of updates available in Debian/Ubuntu-based systemsNumber-
aurNumber of updates available in Arch-based systemsNumber-
brewNumber of updates available in the Homebrew Package ManagerNumber-
dnfNumber of updates available in Fedora-based systemsNumber-
flatpakNumber of updates available in Flatpak packagesNumber-
pacmanNumber of updates available in Arch-based systemsNumber-
snapNumber of updates available in Snap packagesNumber-
xbpsNumber of updates available in Void LinuxNumber-
totalNumber of updates available in all package manager listedNumber-

§Apt

Behind the scenes this uses apt, and in order to run it without root privileges i3status-rust will create its own package database in /tmp/i3rs-apt/ which may take up several MB or more. If you have a custom apt config then this block may not work as expected - in that case please open an issue.

Tip: You can grab the list of available updates using APT_CONFIG=/tmp/i3rs-apt/apt.conf apt list --upgradable

§Pacman

Requires fakeroot to be installed (only required for pacman).

Tip: You can grab the list of available updates using fakeroot pacman -Qu --dbpath /tmp/checkup-db-i3statusrs-$USER/. If you have the CHECKUPDATES_DB env var set on your system then substitute that dir instead.

Note: pikaur may hang the whole block if there is no internet connectivity reference. In that case, try a different AUR helper.

§Pacman hook

Tip: On Arch Linux you can setup a pacman hook to signal i3status-rs to update after packages have been upgraded, so you won’t have stale info in your pacman block.

In the block configuration, set signal = 1 (or another number if 1 is being used by some other block):

[[block]]
block = "packages"
signal = 1

Create /etc/pacman.d/hooks/i3status-rust.hook with the below contents:

[Trigger]
Operation = Upgrade
Type = Package
Target = *

[Action]
When = PostTransaction
Exec = /usr/bin/pkill -SIGRTMIN+1 i3status-rs

§Example

Apk-only config:

[[block]]
block = "packages"
package_manager = ["apk"]
interval = 1800
error_interval = 300
max_retries = 5
format = " $icon $apk.eng(w:1) updates available "
format_singular = " $icon One update available "
format_up_to_date = " $icon system up to date "
[[block.click]]
# shows dmenu with available updates. Any dmenu alternative should also work.
button = "left"
cmd = "apk --no-cache --upgradable list | dmenu -l 10"

Apt-only config

[[block]]
block = "packages"
interval = 1800
error_interval = 300
max_retries = 5
package_manager = ["apt"]
format = " $icon $apt updates available"
format_singular = " $icon One update available "
format_up_to_date = " $icon system up to date "
[[block.click]]
# shows dmenu with cached available updates. Any dmenu alternative should also work.
button = "left"
cmd = "APT_CONFIG=/tmp/i3rs-apt/apt.conf apt list --upgradable | tail -n +2 | rofi -dmenu"
[[block.click]]
# Updates the block on right click
button = "right"
update = true

Brew-only config:

[[block]]
block = "packages"
package_manager = ["brew"]
interval = 1800
error_interval = 300
max_retries = 5
format = " $icon $brew.eng(w:1) updates available "
format_singular = " $icon One update available "
format_up_to_date = " $icon system up to date "
[[block.click]]
# shows dmenu with available updates. Any dmenu alternative should also work.
button = "left"
cmd = "brew outdated | dmenu -l 10"

Dnf-only config:

[[block]]
block = "packages"
package_manager = ["dnf"]
interval = 1800
error_interval = 300
max_retries = 5
format = " $icon $dnf.eng(w:1) updates available "
format_singular = " $icon One update available "
format_up_to_date = " $icon system up to date "
[[block.click]]
# shows dmenu with cached available updates. Any dmenu alternative should also work.
button = "left"
cmd = "dnf list -q --upgrades | tail -n +2 | rofi -dmenu"

Flatpak-only config:

[[block]]
block = "packages"
package_manager = ["flatpak"]
interval = 1800
error_interval = 300
max_retries = 5
format = " $icon $flatpak.eng(w:1) updates available "
format_singular = " $icon One update available "
format_up_to_date = " $icon system up to date "
[[block.click]]
# shows dmenu with cached available updates. Any dmenu alternative should also work.
button = "left"
cmd = "flatpak remote-ls --updates --columns=ref | rofi -dmenu"

Pacman-only config:

[[block]]
block = "packages"
package_manager = ["pacman"]
interval = 600
error_interval = 300
max_retries = 5
format = " $icon $pacman updates available "
format_singular = " $icon $pacman update available "
format_up_to_date = " $icon system up to date "
[[block.click]]
# pop-up a menu showing the available updates. Replace wofi with your favourite menu command.
button = "left"
cmd = "fakeroot pacman -Qu --dbpath /tmp/checkup-db-i3statusrs-$USER/ | wofi --show dmenu"
[[block.click]]
# Updates the block on right click
button = "right"
update = true

Pacman and AUR helper config:

[[block]]
block = "packages"
package_manager = ["pacman", "aur"]
interval = 600
error_interval = 300
max_retries = 5
format = " $icon $pacman + $aur = $total updates available "
format_singular = " $icon $total update available "
format_up_to_date = " $icon system up to date "
# aur_command should output available updates to stdout (ie behave as echo -ne "update\n")
aur_command = "yay -Qua"

Snap-only config:

[[block]]
block = "packages"
package_manager = ["snap"]
interval = 1800
error_interval = 300
max_retries = 5
format = " $icon $snap.eng(w:1) updates available "
format_singular = " $icon One update available "
format_up_to_date = " $icon system up to date "
[[block.click]]
# shows dmenu with available updates. Any dmenu alternative should also work.
button = "left"
cmd = "snap refresh --list | dmenu -l 10"

Xbps-only config:

[[block]]
block = "packages"
package_manager = ["xbps"]
interval = 1800
error_interval = 300
max_retries = 5
format = " $icon $xbps.eng(w:1) updates available "
format_singular = " $icon One update available "
format_up_to_date = " $icon system up to date "
[[block.click]]
# shows dmenu with available updates. Any dmenu alternative should also work.
button = "left"
cmd = "xbps-install -Mun | dmenu -l 10"

Multiple package managers config:

Update the list of pending updates every thirty minutes (1800 seconds):

[[block]]
block = "packages"
package_manager = ["apk", "apt", "aur", "brew", "dnf", "flatpak", "pacman", "snap", "xbps"]
interval = 1800
error_interval = 300
max_retries = 5
format = " $icon $apk + $apt + $aur + $brew + $dnf + $flatpak + $pacman + $snap + $xbps = $total updates available "
format_singular = " $icon One update available "
format_up_to_date = " $icon system up to date "
# If a linux update is available, but no ZFS package, it won't be possible to
# actually perform a system upgrade, so we show a warning.
warning_updates_regex = "(linux|linux-lts|linux-zen)"
# If ZFS is available, we know that we can and should do an upgrade, so we show
# the status as critical.
critical_updates_regex = "(zfs|zfs-lts)"

§Icons Used

  • update

Modules§

apk
apt
brew
dnf
flatpak
pacman
snap
xbps

Structs§

Config

Enums§

PackageManager

Traits§

Backend

Functions§

has_matching_update
run