-
Notifications
You must be signed in to change notification settings - Fork 87
PluginPackages
Display count of pending package updates across multiple package managers with threshold-based warnings.
5 updates
23 updates
Updates available
| Property | Value |
|---|---|
| Platform | macOS, Linux |
| Dependencies | Package manager: brew, yay, apt, dnf, yum, or pacman
|
| Content Type | dynamic |
| Presence | conditional (hidden when no updates) |
# Add to your tmux configuration
set -g @powerkit_plugins "packages"
# Reload tmux configuration
tmux source-file ~/.tmux.confset -g @powerkit_plugins "packages"
# Backend selection (auto, brew, yay, apt, dnf, yum, pacman)
set -g @powerkit_plugin_packages_backend "auto"
# Brew-specific options (empty by default)
# Use "--greedy" to include all casks (may show false positives for auto-updating apps)
set -g @powerkit_plugin_packages_brew_options ""
# Display options
set -g @powerkit_plugin_packages_show_count "true"
# Icons
set -g @powerkit_plugin_packages_icon ""
# Thresholds
set -g @powerkit_plugin_packages_warning_threshold "10"
set -g @powerkit_plugin_packages_critical_threshold "50"
# Cache (check for updates infrequently - 1 hour)
set -g @powerkit_plugin_packages_cache_ttl "3600"| Option | Type | Default | Description |
|---|---|---|---|
@powerkit_plugin_packages_backend |
enum | auto |
Package manager: auto, brew, yay, apt, dnf, yum, pacman
|
@powerkit_plugin_packages_brew_options |
string | "" |
Additional options for brew outdated command (e.g., --greedy for all casks) |
@powerkit_plugin_packages_show_count |
bool | true |
Show update count |
@powerkit_plugin_packages_icon |
icon | `` | Package icon |
@powerkit_plugin_packages_warning_threshold |
number | 10 |
Warning threshold for update count |
@powerkit_plugin_packages_critical_threshold |
number | 50 |
Critical threshold for update count |
@powerkit_plugin_packages_cache_ttl |
number | 3600 |
Cache duration in seconds (1 hour) |
| State | Condition |
|---|---|
active |
Updates available (count > 0) |
inactive |
No updates available (plugin hidden) |
| Level | Condition |
|---|---|
info |
Updates < warning threshold |
warning |
Updates >= warning threshold and < critical threshold |
error |
Updates >= critical threshold |
| Context | Description |
|---|---|
up_to_date |
No updates available (count = 0) |
few_updates |
1-5 updates available |
some_updates |
6-20 updates available |
many_updates |
More than 20 updates available |
set -g @powerkit_plugins "packages"set -g @powerkit_plugins "packages"
set -g @powerkit_plugin_packages_show_count "false"set -g @powerkit_plugins "packages"
set -g @powerkit_plugin_packages_warning_threshold "5"
set -g @powerkit_plugin_packages_critical_threshold "20"set -g @powerkit_plugins "packages"
set -g @powerkit_plugin_packages_cache_ttl "1800" # 30 minutesset -g @powerkit_plugins "cpu,memory,disk,packages"The plugin automatically detects and uses the appropriate package manager:
| Package Manager | Platform | Command Used |
|---|---|---|
| Homebrew | macOS | brew outdated [options] |
| yay | Arch (AUR) | yay -Qu |
| DNF | Fedora/RHEL 8+ | dnf check-update -q |
| APT | Debian/Ubuntu | apt list --upgradable |
| YUM | RHEL/CentOS 7 | yum check-update -q |
| Pacman | Arch/Manjaro | pacman -Qu |
By default, the plugin runs brew outdated without the --greedy flag. This checks only:
- Formula packages (command-line tools)
- Casks with version strings tracked by Homebrew
What --greedy does:
- Includes all casks, even those with
version :latestor auto-updating apps - May show false positives for apps that update independently (Chrome, VSCode, etc)
- These apps don't sync their installed version back to Homebrew
When to use --greedy:
# If you want to check ALL casks (including auto-updating apps)
set -g @powerkit_plugin_packages_brew_options "--greedy"Recommended approach:
- Use default (no
--greedy) for accurate count - Manually run
brew outdated --greedyperiodically to check casks - Update casks with:
brew upgrade --cask --greedy
| Condition | Output |
|---|---|
show_count = true |
X updates (e.g., 23 updates) |
show_count = false |
Updates available |
| No updates | (hidden) |
Package update checks can be slow (especially apt and yum). The default cache TTL is 1 hour to minimize performance impact.
Important: The plugin does NOT run apt-get update or equivalent commands. It only checks what updates are available based on the last refresh. To ensure accuracy:
# macOS
brew update
# Debian/Ubuntu
sudo apt update
# RHEL/Fedora
sudo yum check-update
# Arch
sudo pacman -Sy-
Verify package manager is available:
which brew # or apt, yum, pacman -
Manually check for updates:
# macOS brew outdated # Debian/Ubuntu apt list --upgradable # RHEL/Fedora yum list updates # Arch pacman -Qu
-
Clear cache and test:
rm ~/.cache/tmux-powerkit/data/cache_plugin_packages_* POWERKIT_ROOT="/path/to/tmux-powerkit" ./bin/powerkit-plugin packages
The plugin caches results for 1 hour by default. To force refresh:
-
Clear the cache:
rm ~/.cache/tmux-powerkit/data/cache_plugin_packages_*
-
Refresh tmux:
tmux refresh-client
Or reduce cache TTL:
set -g @powerkit_plugin_packages_cache_ttl "600" # 10 minutesSome package managers may require sudo for certain operations. The plugin uses read-only commands that shouldn't require elevated privileges:
-
brew outdated- no sudo required -
apt list- no sudo required (butapt updatedoes) -
yum list- may require sudo on some systems -
pacman -Qu- no sudo required
If you encounter permission errors with yum:
# Add user to wheel group or configure sudoers
sudo usermod -aG wheel $USERIf the plugin is causing tmux to lag:
-
Increase cache TTL:
set -g @powerkit_plugin_packages_cache_ttl "7200" # 2 hours
-
Check package manager performance:
time brew outdated # Should complete in < 2 seconds time apt list --upgradable # May be slower
- PluginCpu - Display CPU usage
- PluginMemory - Display memory usage
- PluginDisk - Display disk usage