2023-01-24 13:21:04 +01:00
|
|
|
|
### Session --------------------------------------------------------------
|
|
|
|
|
# -sXX : XX session ID or name
|
|
|
|
|
# -nWINDOW_NAME : Name of the window…
|
|
|
|
|
# -d : Don't attache to the new session/window/pane/…
|
|
|
|
|
# -tXX:YY.ZZ :
|
|
|
|
|
# XX : session ID or name
|
|
|
|
|
# YY : (optional) Window ID
|
|
|
|
|
# ZZ : (optional) Pane ID
|
|
|
|
|
# YY and ZZ should exists to be able to change the parameters,…
|
|
|
|
|
# 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
|
|
|
|
|
|
2024-03-15 13:20:03 +01:00
|
|
|
|
# Manage new window for system upgrade
|
2023-01-24 13:21:04 +01:00
|
|
|
|
|
|
|
|
|
# If a session already exists {{{
|
|
|
|
|
if-shell -b 'tmux has-session' {
|
|
|
|
|
|
|
|
|
|
# Window for system update
|
2023-02-27 10:25:05 +01:00
|
|
|
|
# Run upgrade only if packages to upgrade
|
2023-01-24 13:21:04 +01:00
|
|
|
|
display-message "Create a new window for system update"
|
2024-03-15 13:20:03 +01:00
|
|
|
|
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"'
|
2024-06-13 14:25:11 +02:00
|
|
|
|
if 'command -v pacman' 'new-window -nPACMAN "sudo pacman --sync --refresh --; test $(pacman --query --upgrades -- 2>/dev/null | wc --lines) -ge 1 && { sudo pacman --sync --sysupgrade -- ; sleep 10 } ; logout"'
|
|
|
|
|
if 'command -v yay' 'split-window -v -d "echo Wait for checking AUR upgrades… ; sleep 5 ; yay --sync --refresh --aur --; test $(yay --query --upgrades --aur -- 2>/dev/null | wc --lines) -ge 1 && { sleep 5 ; yay --sync --sysupgrade --aur -- ; sleep 10 } ; logout"'
|
2023-01-24 13:21:04 +01:00
|
|
|
|
}
|
|
|
|
|
# }}}
|