Extending light/dark change detection to fish shell with os.execute
#5951
Replies: 1 comment 3 replies
-
First take a look at: Second: that config will spawn a fish subprocess every time the config file is evaluated.
so I would strongly recommend against doing that. Look at using https://wezfurlong.org/wezterm/config/lua/wezterm/GLOBAL.html to remember the last observed value for the appearance and only spawn fish when the value changes. Thirdly: |
Beta Was this translation helpful? Give feedback.
-
What Operating System(s) are you running on?
macOS
Which Wayland compositor or X11 Window manager(s) are you using?
No response
WezTerm version
20240203-110809-5046fc22
Ask your question!
Hi!
I'm trying to extend the OS appearance detection as demoed here
to fish shell. In my fish config I have a function that gets called whenever universal variable
OS_APPEARANCE
changes value:This can be set from anywhere (even different shell or terminal) with
fish -c 'set --universal OS_APPEARANCE {light, dark}'
I tested this in different terminals and shells and even in lua:
lua -e "os.execute([[fish -c 'set --universal OS_APPEARANCE dark']])"
and the call works every time.
However, when I put it inside
~/.wezterm.lua
like this:fish never reacts. Is there a way to get around this?
Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions