Skip to content

Commit

Permalink
fix: update config vars
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwjackson committed Apr 13, 2024
1 parent 8fb0681 commit ba8ee72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/bin/tmesh
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,16 @@ TMUX="${TMUX:-}"
TERM="${TERM:-}"
SERVER="${SERVER:=$(hostname)}"
SCRIPT_DIR="$(dirname "$0")"
TMUX_CONFIG=${TMUX_CONFIG:=$(cat /etc/tmesh/tmesh.tmux.conf)}
TMUX_CONFIG=$(cat /etc/tmesh/tmesh.tmux.conf)
export TMESH_SOCKET=${TMESH_SOCKET:-"tmesh"}

read -r -d '' tmesh_default_config <<EOM
read -r -d '' tmux_default_config <<EOM
# Server Switcher
bind-key -n 'M-A' display-popup -E -w 80% -h 80% "${SCRIPT_DIR@Q}/choose-nest.sh"
EOM

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

tmux_config=(
"${tmesh_default_config[@]}"
"${tmux_default_config[@]}"
"${TMUX_CONFIG[@]}"
)

Expand Down
8 changes: 4 additions & 4 deletions src/bin/tmesh-server
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

SCRIPT_DIR="$(dirname "$0")"
TMESH_SERVER_SOCKET=${TMESH_SERVER_SOCKET:-"tmesh-server"}
TMUX_CONFIG=${TMUX_CONFIG:=$(cat /etc/tmesh/tmesh-server.tmux.conf)}
TMUX_CONFIG=$(cat /etc/tmesh/tmesh-server.tmux.conf)
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_server_default_config <<EOM
read -r -d '' tmux_default_config <<EOM
# Project switcher
bind-key -n 'M-a' display-popup -E -w 80% -h 80% "${SCRIPT_DIR@Q}/choose-session.sh"
EOM

tmux_config=(
"${tmesh_server_default_config[@]}"
"${TMESH_CONFIG[@]}"
"${tmux_default_config[@]}"
"${TMUX_CONFIG[@]}"
)

tmux \
Expand Down

0 comments on commit ba8ee72

Please sign in to comment.