From 1032a7fb6aaed9dc8b721356393a6361d40b5c4e Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 25 Apr 2022 12:11:41 +0200 Subject: [PATCH] Replace tmuxp with smug --- .../scripts/{tmuxp-session => tmux-session} | 7 +++- sway/.config/sway/config | 6 +-- tmux/.config/smug/hpc.yml | 15 +++++++ tmux/.config/smug/idlab.yml | 15 +++++++ tmux/.config/smug/local.yml | 40 +++++++++++++++++++ tmux/.config/smug/zion.yml | 24 +++++++++++ tmux/.tmuxp/hpc.yaml | 13 ------ tmux/.tmuxp/idlab.yaml | 13 ------ tmux/.tmuxp/local.yaml | 34 ---------------- tmux/.tmuxp/zion.yaml | 20 ---------- 10 files changed, 103 insertions(+), 84 deletions(-) rename scripts/.local/share/scripts/{tmuxp-session => tmux-session} (75%) create mode 100644 tmux/.config/smug/hpc.yml create mode 100644 tmux/.config/smug/idlab.yml create mode 100644 tmux/.config/smug/local.yml create mode 100644 tmux/.config/smug/zion.yml delete mode 100644 tmux/.tmuxp/hpc.yaml delete mode 100644 tmux/.tmuxp/idlab.yaml delete mode 100644 tmux/.tmuxp/local.yaml delete mode 100644 tmux/.tmuxp/zion.yaml diff --git a/scripts/.local/share/scripts/tmuxp-session b/scripts/.local/share/scripts/tmux-session similarity index 75% rename from scripts/.local/share/scripts/tmuxp-session rename to scripts/.local/share/scripts/tmux-session index 355f11d..c940846 100755 --- a/scripts/.local/share/scripts/tmuxp-session +++ b/scripts/.local/share/scripts/tmux-session @@ -12,7 +12,12 @@ select_action() { } launch_session() { - bash -c "tmuxp load ~/.tmuxp/$1.yaml" + 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 } execute_action() { diff --git a/sway/.config/sway/config b/sway/.config/sway/config index 5c689f6..10ac9fe 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 -# tmuxp session menu -bindsym $mod+Shift+s exec ~/.local/share/scripts/tmuxp-session +# tmux session menu +bindsym $mod+Shift+s exec ~/.local/share/scripts/tmux-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 -- tmuxp load ~/.tmuxp/local.yaml +exec kitty --class tmux -- smug start local # firefox assign [app_id="firefox"] $workspace2 exec firefox diff --git a/tmux/.config/smug/hpc.yml b/tmux/.config/smug/hpc.yml new file mode 100644 index 0000000..914e0b1 --- /dev/null +++ b/tmux/.config/smug/hpc.yml @@ -0,0 +1,15 @@ +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 new file mode 100644 index 0000000..ac1226d --- /dev/null +++ b/tmux/.config/smug/idlab.yml @@ -0,0 +1,15 @@ +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 new file mode 100644 index 0000000..e53475c --- /dev/null +++ b/tmux/.config/smug/local.yml @@ -0,0 +1,40 @@ +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 new file mode 100644 index 0000000..b64cb58 --- /dev/null +++ b/tmux/.config/smug/zion.yml @@ -0,0 +1,24 @@ +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 deleted file mode 100644 index 5e2efd2..0000000 --- a/tmux/.tmuxp/hpc.yaml +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 0b4f55e..0000000 --- a/tmux/.tmuxp/idlab.yaml +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index e52576c..0000000 --- a/tmux/.tmuxp/local.yaml +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index 8156831..0000000 --- a/tmux/.tmuxp/zion.yaml +++ /dev/null @@ -1,20 +0,0 @@ -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"