1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-30 06:03:39 +03:00

docs: update gui.get_appearance example for mux

refs: https://github.com/wez/wezterm/issues/3453
This commit is contained in:
Wez Furlong 2023-04-06 15:55:20 -07:00
parent 760864b6b2
commit 889390a448
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -19,6 +19,15 @@ automatically adjust to the current appearance:
```lua ```lua
local wezterm = require 'wezterm' 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) function scheme_for_appearance(appearance)
if appearance:find 'Dark' then if appearance:find 'Dark' then
return 'Builtin Solarized Dark' return 'Builtin Solarized Dark'
@ -28,7 +37,7 @@ function scheme_for_appearance(appearance)
end end
return { return {
color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()), color_scheme = scheme_for_appearance(get_appearance()),
} }
``` ```