diff --git a/utils/backdrops.lua b/utils/backdrops.lua index 29a51be..030fd03 100644 --- a/utils/backdrops.lua +++ b/utils/backdrops.lua @@ -40,14 +40,11 @@ end --- --- INFO: --- During the initial load of the config, this function can only invoked in `wezterm.lua`. ---- WezTerm's fs utility `read_dir` (used in this function) works by running on a spawned child process. +--- WezTerm's fs utility `glob` (used in this function) works by running on a spawned child process. --- This throws a coroutine error if the function is invoked in outside of `wezterm.lua` in the - --- initial load of the Terminal config. function BackDrops:set_files() - self.files = wezterm.glob(GLOB_PATTERN, wezterm.config_dir .. PATH_SEP .. 'backdrops') - for idx, file in ipairs(self.files) do - self.files[idx] = wezterm.config_dir .. PATH_SEP .. 'backdrops' .. PATH_SEP .. file - end + self.files = wezterm.glob(wezterm.config_dir .. PATH_SEP .. 'backdrops' .. PATH_SEP .. GLOB_PATTERN) wezterm.GLOBAL.background = self.files[1] return self end