Skip to content

Commit

Permalink
feat: improved glob pattern (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSilvester committed Oct 6, 2024
1 parent ea5fba3 commit 066751b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions utils/backdrops.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 066751b

Please sign in to comment.