skhd icon indicating copy to clipboard operation
skhd copied to clipboard

Run commands through /usr/bin/env sh -c instead of $SHELL -c

Open dominiklohmann opened this issue 5 years ago • 6 comments

Run commands through /usr/bin/env sh -c instead of $SHELL -c.

This is directly related to koekeishiya/yabai#34 and also serves as future-proofing for macOS 10.15, where /bin/zsh will be the default shell instead of /bin/bash. Having consistency between skhd and yabai is definitely desirable.

This might be a breaking change for people that run launchctl setenv SHELL "/path/to/custom/shell" to change the shell for launchctl only, which seems worth discussing. Similar options have been discussed as part of #42.

dominiklohmann avatar Jun 10 '19 22:06 dominiklohmann

this would also make configs more portable. a config written for fish will not work with zsh and vice versa. I use fish and I would very much like the possibility to set a default shell in the config to have it portable should I switch login shell in the future.

basbebe avatar Jul 01 '21 12:07 basbebe

another reason for using sh by default: https://github.com/stephen-huan/dotfiles/blob/master/doc/skhd.md long delays – as already discussed in this repo.

basbebe avatar Jul 03 '21 10:07 basbebe

It seems like Im having issues running skhd inside bash, or anywhere due to this issue. Fish is my default shell.

fish: Command substitutions not allowed
yabai -m window --swap east || $(yabai -m window --display east; yabai -m display --focus east)

Is there some configuration quickfix?

ariel-frischer avatar Apr 16 '22 16:04 ariel-frischer

Is there some configuration quickfix?

@ariel-frischer I guess this is what you are looking for:

https://github.com/koekeishiya/skhd/issues/42#issuecomment-401886533

(use brew edit to have skhd use bash (or dash) instead of the user shell)

basbebe avatar Apr 16 '22 17:04 basbebe

This fix should be implemented in the formula. I was about to give up on yabai because of the lag.

luisbc92 avatar Apr 22 '22 16:04 luisbc92

Not sure why this isn't part of the launchagent, someone probably should make a PR to do that.

pencilcheck avatar May 19 '23 01:05 pencilcheck