Skip to content

Commit

Permalink
feat: Adding config to toggle status bar
Browse files Browse the repository at this point in the history
  • Loading branch information
gmatheu committed Dec 12, 2024
1 parent 284b8a8 commit 906b145
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 🙌
Expand Down
1 change: 1 addition & 0 deletions floax.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
3 changes: 2 additions & 1 deletion scripts/floax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 906b145

Please sign in to comment.