tmux/splitLAPTOP

60 lines
2.0 KiB
Plaintext
Raw Normal View History

### 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
# 'exec ${SHELL}': Allow to keep the pane running after the program exists
# Manage session named **toto** for laptop
# 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
}
# }}}
2022-12-21 11:39:57 +01:00
# If file was source from a running tmux
# This allow to run tmux source-file command outside of Tmux…
if-shell -b 'test -n $TMUX' {
# 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}'
2023-06-12 10:31:47 +02:00
## Split the first window
split-window -v -p 25
2022-12-21 11:39:57 +01:00
# Second window named **Xt0p** with btop running
new-window -d -nXt0p 'btop ; exec ${SHELL}'
2023-06-12 10:31:47 +02:00
2022-12-21 11:39:57 +01:00
# Third window named **ch4t** with weechat running
new-window -d -nch4t 'weechat ; exec ${SHELL}'
2023-06-12 10:31:47 +02:00
2022-12-21 11:39:57 +01:00
# Fourth window named **git** in main repos directory
new-window -d -ngit -c '/home/jegardai/repos'
2023-06-12 10:31:47 +02:00
2022-12-21 11:39:57 +01:00
# Fifth window for authentication tools
source-file $HOME/.tmux/splitAUTHENTICATION
2022-12-21 11:39:57 +01:00
2023-06-12 10:31:47 +02:00
# Sixth window for APT upgrade
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'
2022-12-21 11:39:57 +01:00
# Default pane should be toto:5.2
#select-pane -ttoto:5.2
}
# If a default session still exists {{{
if-shell -b 'tmux has-session -t 0' {
# Kill it
kill-session -t 0
}
# }}}
}