···11+#!/usr/bin/env bash
22+# Jump to terminal and switch to email tmux session
33+44+TERMINAL_CLASS="foot"
55+SESSION_TARGET="neomd:reading" # Change this if your session name is different
66+77+# Get the address of the first terminal window
88+TERMINAL_ADDR=$(hyprctl clients -j | jq -r ".[] | select(.class == \"$TERMINAL_CLASS\") | .address" | head -n1)
99+1010+if [ -n "$TERMINAL_ADDR" ]; then
1111+ # Focus the terminal window
1212+ hyprctl dispatch focuswindow "address:$TERMINAL_ADDR"
1313+1414+ # sleep 0.0000000000000000001
1515+1616+ # Switch to the target tmux session directly
1717+ tmux switch-client -t "$SESSION_TARGET" 2>/dev/null
1818+else
1919+ notify-send "Terminal not found" "No $TERMINAL_CLASS window is currently open" -t 3000
2020+fi
+3-2
tmux/.config/tmux/tmux.conf
···106106bind-key -n M-p switch-client -t dedp-book:writing
107107bind-key -n M-w switch-client -t writing-ssp-data:rill
108108bind-key -n M-m switch-client -t neomd:reading
109109-bind-key -n M-t run-shell -b "~/.config/tmux/tmux-switch-session.sh"
110110-bind-key -n M-s display-popup -E -w 40% "sesh connect \"$(sesh list -i | gum filter --limit 1 --placeholder 'Pick a sesh' --prompt='⚡')\""
109109+# general
110110+bind-key -n M-s run-shell -b "~/.config/tmux/tmux-switch-session.sh"
111111+bind-key -n M-t display-popup -E -w 40% "sesh connect \"$(sesh list -i | gum filter --limit 1 --placeholder 'Pick a sesh' --prompt='⚡')\""
111112112113# set switching between last active tabs forth and back
113114bind-key k select-window -l