3

I'm trying to do something like if-shell "[[ -r $(python -m site --user-site)/powerline/bindings/tmux/powerline.conf ]]" 'source "$(python -m site --user-site)/powerline/bindings/tmux/powerline.conf"' , but it doesn't quite work. I don't want to hard code the path because it might be different between Linux and Mac.

3

The problem is that in the syntax:

if-shell shell-command tmux-command1 tmux-command2

you can use $() in the 2nd part shell-command as the shell will interpret this, but not in the two tmux command parts. One solution is to make the tmux command a run-shell that runs tmux source-file, i.e. replace your 'source...' by

 'run-shell "tmux source-file $(python -m site --user-site)/powerline/bindings/tmux/powerline.conf"'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.