Skip to content

Commit

Permalink
feat: custom tmux config for tmesh-server
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwjackson committed Apr 11, 2024
1 parent 820718b commit 410c826
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/bin/tmesh-server
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@ TMESH_CONFIG=${TMESH_CONFIG:="/etc/tmesh/config.json"}

COMMAND="$(yq -e -oy '.local-tmesh-server.command' "${TMESH_CONFIG}" 2>/dev/null || echo "${SHELL}")"

read -r -d '' tmesh_default_config <<EOM
# Project switcher
bind-key -n 'M-s' display-popup -E -w 80% -h 80% "${SCRIPT_DIR@Q}/choose-session.sh"
EOM

tmesh_server_default_config=${tmesh_default_config/@TERM/$TERM}

tmux_config=(
"${tmesh_server_default_config[@]}"
"${TMESH_USER_CONFIG[@]}"
)

tmux \
-L "${TMESH_SERVER_SOCKET}" \
-f "${TMUX_CONFIG}" \
-f <(printf "%s\n" "${tmux_config[@]}") \
attach-session \
-t terminals ||
tmux \
Expand Down

0 comments on commit 410c826

Please sign in to comment.