walker
This commit is contained in:
36
walker/.config/elephant/menus/nsfw.lua
Normal file
36
walker/.config/elephant/menus/nsfw.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
Name = "nsfw"
|
||||
NamePretty = "Wallpaper switcher"
|
||||
Icon = "applications-other"
|
||||
Cache = true
|
||||
Action = "swww img %VALUE%"
|
||||
HideFromProviderlist = false
|
||||
Description = "Wallpaper change menu"
|
||||
SearchName = true
|
||||
Parent = "wallpaper"
|
||||
refresh_on_change = "/home/arch/Pictures/Wallpapers/NSFW"
|
||||
|
||||
function GetEntries()
|
||||
local entries = {}
|
||||
local wallpaper_dir = "/home/arch/Pictures/Wallpapers/NSFW"
|
||||
|
||||
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("([^/]+)$")
|
||||
if filename then
|
||||
table.insert(entries, {
|
||||
Text = filename,
|
||||
Subtext = "wallpaper",
|
||||
Value = line,
|
||||
Preview = line,
|
||||
PreviewType = "file",
|
||||
Icon = line
|
||||
})
|
||||
end
|
||||
end
|
||||
handle:close()
|
||||
end
|
||||
return entries
|
||||
end
|
||||
Reference in New Issue
Block a user