tyrumus / dotfiles-old

My dotfiles for my setup (AwesomeWM 4.2) and some future dreams
http://imgur.com/gallery/E9dQ0
MIT License
9 stars 1 forks source link

Wallpaper time change function issues #1

Closed SethBarberee closed 7 years ago

SethBarberee commented 7 years ago
awesome v4.1 (Technologic)
 • Compiled against Lua 5.3.4 (running with Lua 5.3)
 • D-Bus support: ✔
 • execinfo support: ✔
 • xcb-randr version: 1.5
 • LGI version: 0.9.1

I copied the same code for the wallpaperChanger and replaced the set_wallpaper function into my rc.lua. I made the wallpapers array like so:

local function set_wallpaper(s)
    local hr = tonumber(string.sub(os.date("%R"), 1, 2))
    if hr >= 0 and hr <= 4 then --night
        gears.wallpaper.maximized(wallpapers[4], s, true)
    elseif hr >= 5 and hr <= 8 then -- morning
        gears.wallpaper.maximized(wallpapers[1], s, true)
    elseif hr >= 9 and hr <= 15 then -- day
        gears.wallpaper.maximized(wallpapers[2], s, true)
    elseif hr >= 16 and hr <= 18 then -- evening
        gears.wallpaper.maximized(wallpapers[3], s, true)
    elseif hr >= 19 and hr <= 23 then -- night
        gears.wallpaper.maximized(wallpapers[4], s, true)
    end
end
local wlpr_timer = timer({timeout = 60})
wlpr_timer:connect_signal("timeout", function() set_wallpaper(1) end)
wlpr_timer:start()

theme/alage/wallpapers is my directory for my wallpapers that I want to use

wallpapers = {
    config_path.."themes/alage/wallpapers/morning.png",
    config_path.."themes/algae/wallpapers/day.png",
    config_path.."themes/algae/wallpapers/evening.jpg",
    config_path.."themes/algae/wallpapers/night.jpg"
}

This however caused an error: INVALID_MATRIX in the wallpaper.lua file Did you ever encounter this error? If so, how did you solve it? If not, any ideas on how to fix it?

SethBarberee commented 7 years ago

I'm sorry... just looked at the logs. I put the wrong extension and so it couldn't find the file. Hence the error. Great work!

tyrumus commented 7 years ago

Glad you were able to figure this out. I was out of town when you posted this issue, hence the late reply.

Glad you like the setup. If you run into other issues, let me know, as I'm sure there are things I missed when trying to untangle the mess of hard-coded spaghetti code. I check Github often (when in town of course).