Run upgrade/clean only if some packages to upgrade

This commit is contained in:
gardouille 2023-02-27 10:25:05 +01:00
parent f6b1010c55
commit 3e627904b9
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 2 additions and 1 deletions

View File

@ -16,7 +16,8 @@
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 ; sudo aptitude full-upgrade ; sudo aptitude clean ; exec ${SHELL}'
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'
}
# }}}