configuration.nix/packages/scripts/tmux-sessions.sh
2023-05-18 20:10:30 +05:30

12 lines
304 B
Bash
Executable file

#!/bin/sh
set -eu
SESSION="$(tmux list-sessions -F "(#{session_attached}) #S [#{pane_current_command} in #{pane_current_path}] #{pane_title}" | sort | rofi -dmenu -p "Running TMUX Sessions" | awk '{print $2}')"
case "$SESSION" in
"")
;;
*)
kitty tmux attach-session -dEt "$SESSION"
;;
esac