This commit is contained in:
2026-03-09 03:00:29 +03:00
parent bb2818a6aa
commit 7f7859534a
11 changed files with 675 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
Name = "wallpaper"
NamePretty = "Wallpaper switcher"
Description = "Wallpaper change menu"
Icon = "applications-other"
HideFromProviderlist = true
SearchName = true
Cache = true
RefreshOnChange = {"/home/arch/Pictures/Wallpapers"}
FixedOrder = true
function GetEntries()
local wallpaper_dir = os.getenv('HOME').."/Pictures/Wallpapers"
local entries = {}
local handle = io.popen("find '"..wallpaper_dir.."' -maxdepth 1 -type f -name '*.jpg' -o -name '*.jpeg' -o -name '*.png' -o -name '*.gif' -o -name '*.bmp' -o -name '*.webp' 2>/dev/null")
if handle then
for line in handle:lines() do
local filename = line:match("([^/]+)$"):gsub('%..*', '')
if filename then
table.insert(entries, {
Text = filename,
PreviewType = "file",
Preview = line,
Icon = line,
Value = line,
Actions = {set = "swww img %VALUE%"}
})
end
end
handle:close()
end
table.insert(entries, {
Text = "NSFW",
Icon = "applications-system",
SubMenu = "nsfw"
})
return entries
end