set -o errexit set -o nounset set -o pipefail workspace="$( \ @sway@/bin/swaymsg -t get_workspaces \ | @jq@/bin/jq '.[] | select(.focused==true).name' \ | cut -d"\"" -f2)" session="ws$workspace" if @tmux@/bin/tmux has-session -t "$session" 2>/dev/null && [ -n "$(@tmux@/bin/tmux list-clients -t "$session")" ]; then session="$session-$$" fi exec @tmux@/bin/tmux new-session -A -s "$session" -e "SWAYSOCK=$SWAYSOCK" -e "DISPLAY=$DISPLAY"