2022-12-12 12:06:13 +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,…
|
2015-05-19 22:32:18 +02:00
|
|
|
|
# monitor-activity : permet de mettre en avant une fenêtre quand son contenu reçoit un événement
|
2019-08-22 09:58:10 +02:00
|
|
|
|
# 'exec ${SHELL}' : Allow to keep the pane running after the program exists
|
2015-05-19 21:59:57 +02:00
|
|
|
|
|
2022-12-12 12:06:13 +01:00
|
|
|
|
# Manage session named **toto** for laptop
|
2015-05-19 21:59:57 +02:00
|
|
|
|
|
2022-12-12 12:06:13 +01:00
|
|
|
|
# If a session already exists {{{
|
|
|
|
|
if-shell -b 'tmux has-session -t toto' {
|
|
|
|
|
display-message "Attach to **toto** existing session"
|
|
|
|
|
## Attach to the first pane of the first window
|
|
|
|
|
attach-session -t toto:1.1
|
|
|
|
|
}
|
|
|
|
|
# }}}
|
|
|
|
|
# If no session already exists
|
|
|
|
|
if-shell '! tmux has-session -t toto' {
|
|
|
|
|
display-message "Create a new session for Laptop"
|
|
|
|
|
# A first window named **mail**
|
|
|
|
|
# with mutt running in the first pane
|
|
|
|
|
new-session -A -stoto -nmail 'mutt ; exec ${SHELL}'
|
|
|
|
|
## Split the first window for APT upgrade
|
|
|
|
|
split-window -h -p 25 -ttoto:1.1 'sudo aptitude update ; sudo aptitude full-upgrade ; exec ${SHELL}'
|
|
|
|
|
#
|
|
|
|
|
# Second window named **Xt0p** with btop running
|
|
|
|
|
new-window -d -nXt0p 'btop ; exec ${SHELL}'
|
|
|
|
|
# Third window named **ch4t** with weechat running
|
2022-12-12 15:37:40 +01:00
|
|
|
|
new-window -d -nch4t 'weechat ; exec ${SHELL}'
|
2022-12-12 12:06:13 +01:00
|
|
|
|
# Fourth window named **git** in main repos directory
|
|
|
|
|
new-window -d -ngit -c '/home/jegardai/repos'
|
2022-12-12 15:37:40 +01:00
|
|
|
|
# Fifth window for authentication tools
|
2022-12-13 08:21:51 +01:00
|
|
|
|
new-window -nAuth 'gpg --quiet --for-your-eyes-only --decrypt ~/.password-store/test.gpg ; logout'
|
|
|
|
|
split-window -h 'ssh-add -l | grep -qi -- "(ed25519)" || ssh-add ~/.ssh/id_ed25519 ; logout'
|
2022-12-12 15:37:40 +01:00
|
|
|
|
set-window-option synchronize-panes on
|
2015-05-19 21:59:57 +02:00
|
|
|
|
|
2022-12-12 15:37:40 +01:00
|
|
|
|
# Default pane should be toto:5.2
|
|
|
|
|
#select-pane -ttoto:5.2
|
2022-12-12 12:06:13 +01:00
|
|
|
|
}
|
|
|
|
|
# If a default session still exists {{{
|
|
|
|
|
if-shell -b 'tmux has-session -t 0' {
|
|
|
|
|
# Kill it
|
|
|
|
|
kill-session -t 0
|
|
|
|
|
}
|
|
|
|
|
# }}}
|