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

Add TPM configuration #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add TPM configuration #50

wants to merge 1 commit into from

Conversation

jcf
Copy link

@jcf jcf commented Apr 24, 2021

Purpose

Add TPM configuration to make installation easier.

Approach

Compile gitmux automatically, if the binary isn't in the plugin directory, and generate the default configuration.

You can use something like this in your Tmux configuration:

set -g @plugin 'jcf/gitmux'
set -g status-right '#(~/.config/tmux/plugins/gitmux/gitmux -cfg ~/.config/tmux/plugins/gitmux/gitmux.conf "#{pane_current_path}")'

If gitmux works without a configuration file, you could skip generating the config file, and that would simplify the status-right option.

I'm not sure if this is something you want to merge based on #2, but I thought I'd share for anyone else who wants to run this awesome project alongside TPM.

All the best!

@arl
Copy link
Owner

arl commented Apr 24, 2021

Hi @jcf. Thanks for your pull-request.
I thought about something similar to what you're proposing but I didn't want gitmux to require the user to have Go installed on their system. But you actual made me think to something, the tpm script checking for gitmux could directly download the pre-built binary. This would require to check current architecture and to copy gitmux into the PATH, or giving the user a useful message about why that failed.
I understand that's more involved.
If you wanna give that a go, I'll be happy to review, otherwise we can go with your solution as a first approach.
Since tpm users are not used to a script that fails to install, I'd like error messages in case of failure, like if Go isn't installed .
Let me know, in any case, thanks!

@arl arl changed the base branch from master to main September 24, 2021 10:18
@joshmedeski
Copy link
Contributor

This is an interesting idea, even though we just added homebrew support I could see tpm support making more sense for this project, but the binary would need to be included in version control :(

So far, I think homebrew is a great solution and easy to work with.

CONFIG="$CURRENT_DIR/gitmux.conf"

if [ ! -f "$BINARY" ]; then
tmux split-window "cd $CURRENT_DIR && go build -o gitmux && echo 'Press any key to continue...' && read -k1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to support rebuilding the binary when the plugin is updated.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe best would be to not require the user to have the go toolchain, but automatically download the binary release for their arch/os.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell, tpm just pulls from git when doing an update. I looked through the docs some and don't see a concept of an update hook for us to leverage.

It seems like this may be more complicated than it appears. Look out for scope creep.

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

Successfully merging this pull request may close these issues.

3 participants