reno/libs/imagemagick_blur.lua

12 lines
493 B
Lua
Raw Normal View History

2023-05-06 08:56:25 +00:00
-- If possible, try to blur the image and return its path via callback. Relies on ImageMagick
local awful = require("awful")
return function(image_path,callback)
local blurred_wallpaper_path = "/tmp/.blur_"..image_path:match("[^/]$")
if select(3,os.execute("convert -version")) == 0 then
awful.spawn.easy_async("convert "..image_path.." -blur 0x10 "..blurred_wallpaper_path,function()
callback(blurred_wallpaper_path)
end)
end
return image_path
end