Replace tmuxp session mode with rofi selection
This commit is contained in:
parent
a558a6584a
commit
1357d20275
25
scripts/.local/share/scripts/tmuxp-session
Executable file
25
scripts/.local/share/scripts/tmuxp-session
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
select_action() {
|
||||
action_content=(
|
||||
"zion"
|
||||
"unit"
|
||||
"aegis"
|
||||
)
|
||||
action=$(printf '%s\n' "${action_content[@]}" | rofi -no-auto-select -i "$@" -dmenu -p "Choose a session")
|
||||
execute_action "$action"
|
||||
}
|
||||
|
||||
launch_session() {
|
||||
bash -c "tmuxp load ~/.tmuxp/$1.yaml"
|
||||
}
|
||||
|
||||
execute_action() {
|
||||
case "$1" in
|
||||
"zion") launch_session "zion" ;;
|
||||
"unit") launch_session "unit" ;;
|
||||
"aegis") launch_session "aegis" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
select_action "$@"
|
@ -283,6 +283,8 @@ bindsym Shift+Print exec slurp | grim -g - - | wl-copy
|
||||
bindsym $mod+f exec ~/.local/share/scripts/finder
|
||||
# temporary popup window selection
|
||||
bindsym $mod+p exec ~/.local/share/scripts/popup-window
|
||||
# tmuxp session menu
|
||||
bindsym $mod+Shift+s exec ~/.local/share/scripts/tmuxp-session
|
||||
# power menu
|
||||
bindsym $mod+Shift+p mode "$Pause-break"
|
||||
|
||||
@ -309,20 +311,6 @@ mode "$Theme-switch" {
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
# tmuxp session menu
|
||||
bindsym $mod+Shift+s mode "$tmuxp-session"
|
||||
|
||||
set $tmuxp-session (z) zion, (u) unit
|
||||
|
||||
mode "$tmuxp-session" {
|
||||
bindsym z exec --no-startup-id tmuxp load ~/.tmuxp/zion.yaml, mode "default"
|
||||
bindsym u exec --no-startup-id tmuxp load ~/.tmuxp/unit.yaml, mode "default"
|
||||
bindsym a exec --no-startup-id tmuxp load ~/.tmuxp/aegis.yaml, mode "default"
|
||||
|
||||
bindsym Return mode "default"
|
||||
bindsym Escape mode "default"
|
||||
}
|
||||
|
||||
# lock screen on suspend
|
||||
set $lock_bg ~/Photos/Wallpapers/wallhaven-638719.png
|
||||
exec swayidle -w \
|
||||
|
Loading…
Reference in New Issue
Block a user