Support Pacman upgrades

This commit is contained in:
gardouille 2024-03-15 13:20:03 +01:00
parent 43994b3aa3
commit feb16388cf
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 3 additions and 2 deletions

View File

@ -10,7 +10,7 @@
# monitor-activity : permet de mettre en avant une fenêtre quand son contenu reçoit un événement
# 'exec ${SHELL}': Allow to keep the pane running after the program exists
# Manage new window for APT update
# Manage new window for system upgrade
# If a session already exists {{{
if-shell -b 'tmux has-session' {
@ -18,6 +18,7 @@ if-shell -b 'tmux has-session' {
# Window for system update
# Run upgrade only if packages to upgrade
display-message "Create a new window for system update"
new-window -nAPT 'sudo apt update ; test $(apt list --upgradable 2>/dev/null | wc --lines) -gt 1 && { sudo aptitude full-upgrade ; sudo aptitude clean } ; logout'
if 'command -v apt' 'new-window -nAPT "sudo apt update ; test $(apt list --upgradable 2>/dev/null | wc --lines) -gt 1 && { sudo aptitude full-upgrade ; sudo aptitude clean } ; logout"'
if 'command -v pacman' 'new-window -nPACMAN "sudo pacman --sync --refresh --; test $(pacman --query --upgrades -- 2>/dev/null | wc --lines) -gt 1 && { sudo pacman --sync --sysupgrade -- } ; logout"'
}
# }}}