Reattach tmux sessions on alacritty start
This commit is contained in:
@@ -30,10 +30,14 @@ scrolling:
|
|||||||
history: 0
|
history: 0
|
||||||
|
|
||||||
shell:
|
shell:
|
||||||
program: tmux
|
program: zsh
|
||||||
|
args:
|
||||||
|
- "-c"
|
||||||
|
- "$HOME/.tmux/tmux_attach.sh"
|
||||||
|
|
||||||
alt_send_esc: false
|
alt_send_esc: false
|
||||||
live_config_reload: true
|
live_config_reload: true
|
||||||
|
|
||||||
key_bindings:
|
key_bindings:
|
||||||
- { key: F, mods: Control, command: {program: "zsh", args: ["-c","PATH=/usr/local/bin:$PATH python3 ~/.config/alacritty/color_switcher.py 2>&1 >> /tmp/ala.log"]} }
|
- { key: F, mods: Control, command: {program: "zsh", args: ["-c","PATH=/usr/local/bin:$PATH python3 ~/.config/alacritty/color_switcher.py"]} }
|
||||||
|
- { key: T, mods: Command, command: {program: "alacritty", args: ["-e","zsh"]} } # Spawn alacritty without tmux
|
||||||
|
|||||||
13
tmux/tmux_attach.sh
Executable file
13
tmux/tmux_attach.sh
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# tmux-attach - attach to first unattached session or
|
||||||
|
# create new session if none are found
|
||||||
|
#
|
||||||
|
N=$(tmux ls | grep -v attached | head -1 | cut -d: -f1)
|
||||||
|
|
||||||
|
if [[ ! -z $N ]]
|
||||||
|
then
|
||||||
|
ATTACH_OPTS="attach -t $N"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec tmux $ATTACH_OPTS
|
||||||
Reference in New Issue
Block a user