From 906b1452826cc1564e1945927e82a65733422da6 Mon Sep 17 00:00:00 2001 From: "Gonzalo Matheu (framework)" Date: Thu, 12 Dec 2024 15:58:17 -0300 Subject: [PATCH] feat: Adding config to toggle status bar --- README.md | 4 ++++ floax.tmux | 1 + scripts/floax.sh | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 605eec3..ce0e39a 100644 --- a/README.md +++ b/README.md @@ -103,9 +103,13 @@ set -g @floax-session-name 'some-other-session-name' # Change the title of the floating window set -g @floax-title 'floax' + +# If you want to enable the status bar, you can set this to 'on' +set -g @floax-status-bar 'off' ``` ## Known issues 🐞 + - ~Sizing too much down will break the script~ ## Contributors 🙌 diff --git a/floax.tmux b/floax.tmux index 00439aa..a5a6344 100755 --- a/floax.tmux +++ b/floax.tmux @@ -17,6 +17,7 @@ tmux setenv -g FLOAX_TEXT_COLOR "$(tmux_option_or_fallback '@floax-text-color' ' tmux setenv -g FLOAX_TITLE "$(tmux_option_or_fallback '@floax-title' "${DEFAULT_TITLE}")" tmux setenv -g FLOAX_CHANGE_PATH "$(tmux_option_or_fallback '@floax-change-path' 'true')" tmux setenv -g FLOAX_PREFIX "$(tmux_option_or_fallback '@floax-prefix' 'C')" +tmux setenv -g FLOAX_STATUS_BAR "$(tmux_option_or_fallback '@floax-status-bar' 'off')" tmux setenv -g FLOAX_SESSION_NAME "$(tmux_option_or_fallback '@floax-session-name' "${DEFAULT_SESSION_NAME}")" eval "$(tmux showenv -s)" diff --git a/scripts/floax.sh b/scripts/floax.sh index f4b5240..d55ee84 100755 --- a/scripts/floax.sh +++ b/scripts/floax.sh @@ -2,6 +2,7 @@ CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$CURRENT_DIR/utils.sh" +FLOAX_STATUS_BAR=$(envvar_value FLOAX_STATUS_BAR) tmux setenv -g ORIGIN_SESSION "$(tmux display -p '#{session_name}')" if [ "$(tmux display-message -p '#{session_name}')" = "$FLOAX_SESSION_NAME" ]; then @@ -26,7 +27,7 @@ else else # Create a new session named 'scratch' and attach to it tmux new-session -d -c "$(tmux display-message -p '#{pane_current_path}')" -s "$FLOAX_SESSION_NAME" - tmux set-option -t "$FLOAX_SESSION_NAME" status off + tmux set-option -t "$FLOAX_SESSION_NAME" status "${FLOAX_STATUS_BAR}" tmux_popup fi fi