diff --git a/scripts/.local/share/scripts/tmux-session b/scripts/.local/share/scripts/tmuxp-session similarity index 75% rename from scripts/.local/share/scripts/tmux-session rename to scripts/.local/share/scripts/tmuxp-session index c940846..355f11d 100755 --- a/scripts/.local/share/scripts/tmux-session +++ b/scripts/.local/share/scripts/tmuxp-session @@ -12,12 +12,7 @@ select_action() { } launch_session() { - tmux_pid=$(pidof tmux) - if [ -z "$tmux_pid" ]; then - kitty --class tmux -- smug start "$1" - else - tmux run-shell "smug start $1 2&>1 > /dev/null" - fi + bash -c "tmuxp load ~/.tmuxp/$1.yaml" } execute_action() { diff --git a/sway/.config/sway/config b/sway/.config/sway/config index 10ac9fe..5c689f6 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -288,8 +288,8 @@ bindsym Shift+Print exec slurp | grim -g - - | wl-copy bindsym $mod+f exec ~/.local/share/scripts/finder # recurrent action launcher bindsym $mod+Shift+a exec ~/.local/share/scripts/recurrent-actions -# tmux session menu -bindsym $mod+Shift+s exec ~/.local/share/scripts/tmux-session +# tmuxp session menu +bindsym $mod+Shift+s exec ~/.local/share/scripts/tmuxp-session # power menu bindsym $mod+Shift+p exec ~/.local/share/scripts/power-menu @@ -325,7 +325,7 @@ exec wl-paste -t text --watch clipman store --max-items=50 exec kanshi # tmux assign [app_id="tmux"] $workspace1 -exec kitty --class tmux -- smug start local +exec kitty --class tmux -- tmuxp load ~/.tmuxp/local.yaml # firefox assign [app_id="firefox"] $workspace2 exec firefox diff --git a/tmux/.config/smug/hpc.yml b/tmux/.config/smug/hpc.yml deleted file mode 100644 index 914e0b1..0000000 --- a/tmux/.config/smug/hpc.yml +++ /dev/null @@ -1,15 +0,0 @@ -session: hpc - -windows: -- name: canvas - layout: tiled - commands: - - ssh hpc - panes: - - type: vertical - commands: - - ssh hpc - -- name: monitor - commands: - - ssh -t hpc "htop" diff --git a/tmux/.config/smug/idlab.yml b/tmux/.config/smug/idlab.yml deleted file mode 100644 index ac1226d..0000000 --- a/tmux/.config/smug/idlab.yml +++ /dev/null @@ -1,15 +0,0 @@ -session: idlab - -windows: -- name: canvas - layout: tiled - commands: - - ssh idlab - panes: - - type: vertical - commands: - - ssh idlab - -- name: monitor - commands: - - ssh -t idlab "htop" diff --git a/tmux/.config/smug/local.yml b/tmux/.config/smug/local.yml deleted file mode 100644 index e53475c..0000000 --- a/tmux/.config/smug/local.yml +++ /dev/null @@ -1,40 +0,0 @@ -session: local - -windows: -- name: admin - layout : tiled - commands: - - su - panes: - - type: horizontal - commands: - - su - -- name: canvas - layout : tiled - commands: - - clear - panes: - - type: horizontal - commands: - - clear - -- name: docs - commands: - - man zfs - panes: - - type: vertical - commands: - - man nix-shell - -- name: music - commands: - - ncmpcpp - -- name: mail - commands: - - neomutt - -- name: stream - commands: - - clear diff --git a/tmux/.config/smug/zion.yml b/tmux/.config/smug/zion.yml deleted file mode 100644 index b64cb58..0000000 --- a/tmux/.config/smug/zion.yml +++ /dev/null @@ -1,24 +0,0 @@ -session: zion - -windows: -- name: admin - layout : tiled - commands: - - ssh root@zion - panes: - - type: vertical - commands: - - ssh root@zion - -- name: canvas - layout : tiled - commands: - - ssh zion - panes: - - type: vertical - commands: - - ssh zion - -- name: monitor - commands: - - ssh -t zion "htop" diff --git a/tmux/.tmuxp/hpc.yaml b/tmux/.tmuxp/hpc.yaml new file mode 100644 index 0000000..5e2efd2 --- /dev/null +++ b/tmux/.tmuxp/hpc.yaml @@ -0,0 +1,13 @@ +session_name: hpc +suppress_history: false + +windows: +- window_name: canvas + layout: even-vertical + panes: + - ssh hpc + - ssh hpc + +- window_name: monitor + panes: + - ssh -t hpc "htop" diff --git a/tmux/.tmuxp/idlab.yaml b/tmux/.tmuxp/idlab.yaml new file mode 100644 index 0000000..0b4f55e --- /dev/null +++ b/tmux/.tmuxp/idlab.yaml @@ -0,0 +1,13 @@ +session_name: idlab +suppress_history: false + +windows: +- window_name: canvas + layout: even-vertical + panes: + - ssh idlab + - ssh idlab + +- window_name: monitor + panes: + - ssh -t idlab "htop" diff --git a/tmux/.tmuxp/local.yaml b/tmux/.tmuxp/local.yaml new file mode 100644 index 0000000..e52576c --- /dev/null +++ b/tmux/.tmuxp/local.yaml @@ -0,0 +1,34 @@ +session_name: local +suppress_history: false + +windows: +- window_name: admin + focus: true + layout: even-vertical + panes: + - su + - su + +- window_name: canvas + layout: even-vertical + panes: + - null + - null + +- window_name: docs + layout: even-horizontal + panes: + - man zfs + - man nix-shell + +- window_name: music + panes: + - ncmpcpp + +- window_name: mail + panes: + - neomutt + +- window_name: stream + panes: + - null diff --git a/tmux/.tmuxp/zion.yaml b/tmux/.tmuxp/zion.yaml new file mode 100644 index 0000000..8156831 --- /dev/null +++ b/tmux/.tmuxp/zion.yaml @@ -0,0 +1,20 @@ +session_name: zion +suppress_history: false + +windows: +- window_name: admin + focus: true + layout: even-vertical + panes: + - ssh root@zion + - ssh root@zion + +- window_name: canvas + layout: even-vertical + panes: + - ssh zion + - ssh zion + +- window_name: monitor + panes: + - ssh -t zion "htop"