Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Layout formatter for non-git directories #114

Open
lucasqueiroz opened this issue May 30, 2024 · 1 comment
Open

[FEATURE] Layout formatter for non-git directories #114

lucasqueiroz opened this issue May 30, 2024 · 1 comment
Labels
improvement New feature or request

Comments

@lucasqueiroz
Copy link

Is your feature request related to a problem? Please describe.
It would be nice to have a "default" return from the command in case the directory passed as argument is not a git dir.
Currently, it returns an empty string, but I would like to be able to customize this to return a specific string when the directory isn't a git dir.

Describe the solution you'd like
An option in the config file to have a formatter for this. Maybe add an option to the layout list, or have it be separated and empty as default?

Describe alternatives you've considered
Sedding with a default value, but I couldn't get tmux to work the the | sed ..., so it doesn't help.

Additional context
Honestly, I'm using this with catppuccin and when the dir is not a repo, it looks very ugly, so I wanted to have a default to be placed.

@lucasqueiroz lucasqueiroz added the improvement New feature or request label May 30, 2024
@arl
Copy link
Owner

arl commented Jun 9, 2024

It looks like that something that could be handled from tmux configuration rather than in gitmux.

The fact that gitmux returns an empty string when outside a git dir should help, as you hinted the issue description.

What did you try, and what didn't work?

I'd expect something like the following to work. Create a script, put it into your PATH, and call that script instead of calling gitmux directly from your tmux.conf:

output="$(gitmux)"

if [[ -n $output ]]
then
    printf "$output"
else
    printf "not git dir"
fi

Note that I haven't tried it though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants