Run shell script when Alacritty starts

393 Views Asked by At

I'm on macOS Monterrey 12.6.1 with Homebrew installed Alacritty.

I want to run a script when Alacritty launches, echo Hello!

I have this in my alacritty.yml config. But it doesn't work:

shell:
  program: /bin/zsh
  args:
    - -c "/full/path/to/myScript/hello.sh"

1

There are 1 best solutions below

0
MunsMan On

I had a similar Problem, and I was able to solve it by passing the --login flag to zsh. To my understanding, you need to load your environment to execute your script, which is not done automatically. My solution is:

shell: /bin/zsh
args:
    - --login
    - -c
    - /full/path/to/your/script.sh

I hope it solves your Problem.