mirror of
https://github.com/wez/wezterm.git
synced 2024-11-27 02:25:28 +03:00
docs: update gui.get_appearance example for mux
refs: https://github.com/wez/wezterm/issues/3453
This commit is contained in:
parent
760864b6b2
commit
889390a448
@ -19,6 +19,15 @@ automatically adjust to the current appearance:
|
||||
```lua
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
-- wezterm.gui is not available to the mux server, so take care to
|
||||
-- do something reasonable when this config is evaluated by the mux
|
||||
function get_appearance()
|
||||
if wezterm.gui then
|
||||
return wezterm.gui.get_appearance()
|
||||
end
|
||||
return 'Dark'
|
||||
end
|
||||
|
||||
function scheme_for_appearance(appearance)
|
||||
if appearance:find 'Dark' then
|
||||
return 'Builtin Solarized Dark'
|
||||
@ -28,7 +37,7 @@ function scheme_for_appearance(appearance)
|
||||
end
|
||||
|
||||
return {
|
||||
color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()),
|
||||
color_scheme = scheme_for_appearance(get_appearance()),
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user