koekeishiya / skhd

Simple hotkey daemon for macOS
MIT License
6.31k stars 210 forks source link

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

Open dominiklohmann opened 5 years ago

dominiklohmann commented 5 years ago

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.

basbebe commented 3 years ago

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 commented 3 years ago

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.

ariel-frischer commented 2 years ago

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?

basbebe commented 2 years ago

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)

luisbc92 commented 2 years ago

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

pencilcheck commented 1 year ago

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