Picturesque

Description
Picturesque is a small module that automatically fetches a random wallpaper from 4walled.com which in turn is a wallpaper aggregator for 4chan.

Installation

 * Make sure you have asyncshell.lua in your awesome/ directory.


 * You also need wget and curl which you most likely already have.


 * Place picturesque.lua into your awesome/ directory.


 * Ensure that the cache directory exists. The cache dir is by default ~/.cache/awesome/picturesque, but can be changed.


 * In your rc.lua insert the following:

local picturesque = require('picturesque') local t = timer { timeout = 3600 } t:connect_signal("timeout", picturesque.change_image) t:start

The timeout arg you pass to timer is an interval in seconds in which the wallpaper should be updated.

Safe for work
By default SFW is enabled, protecting your screen from occasional unsafe content (people post all kinds of wallpapers to 4chan). If you are feeling risky, you can turn it off.

picturesque.sfw = false

Setting wallpapers
By default picturesque sets the downloaded wallpaper on all screens using gears.wallpaper.maximized function. If you want to change this behaviour, set a different callback.

-- This will set wallpaper only on a second screen, fit the image and use black color as the background. picturesque.callback = function (img) gears.wallpaper.fit(img, 2, "#000000") end

Resolution
By default picturesque uses resolution of the first screen to download a proper wallpaper. You can set a constant resolution yourself if you want to.

picturesque.resolution = "1280x768"

It is also possible to set resolution parameter to a function that returns width and height of the screen.

-- This will use the second screen's parameters as a resolution for wallpapers. picturesque.resolution = function return screen[2].geometry.width, screen[2].geometry.height end

Cache folder
Picturesque stores all downloaded images in ~/.cache/awesome/picturesque/ folder. You can change it by overriding picturesque.cache_folder variable.