How to run script on OS theme change #3687
Replies: 3 comments 5 replies
-
This might be outside of the scope of Ghostty as there is already the option to change the Ghostty theme based on the OS theme (
Not a fish user though im afraid so I cant test it, grain of salt :D |
Beta Was this translation helpful? Give feedback.
-
After doing more research, I gave up and wrote a swift program to listen to the OS theme and trigger the fish shell command: https://github.com/Crocmagnon/os-theme-detector I would find it much simpler if Ghostty provided a native way of doing this without requiring building these blocks, since it's already a swift app and it's already aware of the OS theme change. At least this is terminal-agnostic. |
Beta Was this translation helpful? Give feedback.
-
It wouldn't be terribly difficult to have Ghostty run a command when the theme changes, but that's only the easy part. First of all, does Ghostty run it in the right environment to talk to the rest of your shells? Second, how do you notify all of your shells and other applications to update? There's a lot there that's really out of scope for Ghostty. |
Beta Was this translation helpful? Give feedback.
-
I'd like to run a shell command on OS theme change, to update fish's color scheme.
In iTerm2, I can achieve this using their "scripts" feature. I documented my process here: https://gabnotes.org/terminal-dark-light-mode/
Is there a way to achieve the same thing in Ghostty?
I read #2755, but I'm unsure how I can use the information in there.
Beta Was this translation helpful? Give feedback.
All reactions