Quantcast
Viewing latest article 5
Browse Latest Browse All 969

Help: Rainmeter Skins • Desktop wallpaper changer.

I am trying to mod a skin that on click, changes the wallpaper dynamically from a folder. I am able to get it mostly running using File View. It just doesn't change. When I ran the debug, it shows that it is selecting the same image file despite the image index changing. Can anyone help me see what I am missing? Been on this for days. Image may be NSFW.
Clik here to view.
:jawdrop



Here are my logs:

Code:

NOTE (16:57:42.740) Gemini\main.ini: 📂 Wallpapers available: 6NOTE (16:57:42.740) Gemini\main.ini: ---- DEBUG: full file list ----NOTE (16:57:42.758) Gemini\main.ini: 🔢 #1 = ab.jpgNOTE (16:57:42.772) Gemini\main.ini: 🔢 #2 = ab.jpgNOTE (16:57:42.787) Gemini\main.ini: 🔢 #3 = ab.jpgNOTE (16:57:42.799) Gemini\main.ini: 🔢 #4 = ab.jpgNOTE (16:57:42.811) Gemini\main.ini: 🔢 #5 = ab.jpgNOTE (16:57:42.821) Gemini\main.ini: 🔢 #6 = ab.jpgNOTE (16:57:42.831) Gemini\main.ini: ---- end debug list ----NOTE (16:57:42.842) Gemini\main.ini: 🔀 Chosen index: 4NOTE (16:57:42.853) Gemini\main.ini: 📄 Selected file: ab.jpgNOTE (16:57:43.053) Gemini\main.ini: 🌄 Wallpaper set: ab.jpg

Below is my lua:

Code:

-- @Resources/FileViewWallpaper.lua (working?)-- Debug: dump index→filename, then pick a random onefunction Initialize()    math.randomseed(os.time())    SKIN:Bang("!Log", "✅ Wallpaper script initialized.")endfunction SetRandomWallpaper()    -- 1) Refresh and grab the count    SKIN:Bang("!UpdateMeasure MeasureWallpaperCount")    local count = SKIN:GetMeasure("MeasureWallpaperCount"):GetValue()    SKIN:Bang("!Log", "📂 Wallpapers available: " .. count)    if count < 1 then        SKIN:Bang("!Log", "⚠️ No wallpapers found.")        return    end    -- 2) Dump the full list    SKIN:Bang("!Log", "---- DEBUG: full file list ----")    for i = 1, count do        SKIN:Bang("!SetOption MeasureWallpaperName Index " .. i)        SKIN:Bang("!UpdateMeasure MeasureWallpaperName")        local name = SKIN:GetMeasure("MeasureWallpaperName"):GetStringValue()        SKIN:Bang("!Log", string.format("🔢 #%d = %s", i, name))    end    SKIN:Bang("!Log", "---- end debug list ----")    -- 3) Pick a random index    local idx = math.random(1, count)    SKIN:Bang("!Log", "🔀 Chosen index: " .. idx)    -- 4) Set that Index and read back the filename    SKIN:Bang("!SetOption MeasureWallpaperName Index " .. idx)    SKIN:Bang("!UpdateMeasure MeasureWallpaperName")    local fname = SKIN:GetMeasure("MeasureWallpaperName"):GetStringValue()    SKIN:Bang("!Log", "📄 Selected file: " .. fname)    -- 5) Apply it    local folder = SKIN:GetVariable("WallpaperPath") or ""    local fullPath = (folder .. "\\" .. fname):gsub("/","\\")    SKIN:Bang("!SetWallpaper \"" .. fullPath .. "\" Fill")    SKIN:Bang("!Log", "🌄 Wallpaper set: " .. fname)    -- 6) Loop if AutoLoop = 1    if SKIN:GetVariable("AutoLoop") == "1" then        SKIN:Bang('[!Delay 2000][!CommandMeasure ScriptWallpaper "SetRandomWallpaper()"]')    endendfunction Execute()    SetRandomWallpaper()    return ""end


main.ini (just the relevant part):

Code:

;----- Wallpaper FileView Measures -----[MeasureWallpaperCount]Measure=PluginPlugin=FileViewPath=#WallpaperPath#ShowDotDot=0ShowFile=1ShowFolder=0ShowHidden=0Extensions=jpg;pngType=FileCountUpdateDivider=1[MeasureWallpaperName]Measure=PluginPlugin=FileViewPath=#WallpaperPath#ShowDotDot=0ShowFile=1ShowFolder=0ShowHidden=0Extensions=jpg;pngType=FileNameIndex=1DynamicVariables=1UpdateDivider=1    ; ← ensure this updates every time;----- Script Measure (random wallpaper) -----[ScriptWallpaper]Measure=ScriptScriptFile=#@#FileViewWallpaper.luaFunction=SetRandomWallpaperDisabled=0DynamicVariables=1;x----- UI: Buttons -----x:[MeterButton1]Meter=ImageImageName=#x#ImageTint=#lbackground#W=30X=58Y=63AntiAlias=1LeftMouseUpAction=[!SetVariable AutoLoop "1"][!CommandMeasure ScriptWallpaper "SetRandomWallpaper()"][!Log "[DEBUG] → Started auto-rotate (2 s)"]DynamicVariables=1[Button1Hover]Meter=ShapeShape=Rectangle 58,65,30,30 | Fill Color #white#,1 | StrokeWidth=0MouseOverAction=[!SetOption MeterButton1 ImageTint "#white#"][!Update]MouseLeaveAction=[!SetOption MeterButton1 ImageTint "#lbackground#"][!Update]DynamicVariables=1

Statistics: Posted by don0610 — Today, 7:25 am — Replies 8 — Views 516



Viewing latest article 5
Browse Latest Browse All 969

Trending Articles