Add luadoc comments for awful.screenshot.init and fix a typo in the

mousegrabber callback (use the filename convenience variable 'fname').
This commit is contained in:
Brian Sobulefsky 2021-10-11 21:39:34 -07:00 committed by Emmanuel Lepage Vallee
parent 12a3fae456
commit 18ee0d6bf7
1 changed files with 5 additions and 1 deletions

View File

@ -107,6 +107,10 @@ end
-- Currently only sets the screenshot directory, the filename, prefix and the
-- snipper tool outline color. More initialization can be added as the API
-- expands.
-- @function screenshot.init
-- @tparam string The directory path in which to save screenshots
-- @tparam string The prefix prepended to the screenshot filenames
-- @return true or nil depending on success
function screenshot.init(directory, prefix, color)
local tmp
@ -315,7 +319,7 @@ local function mg_callback(mouse_data)
date_time = tostring(os.date("%Y%m%d%H%M%S"))
fname = dir .. prfx .. date_time .. ".png"
gears.surface(snip_surf):write_to_png(dir .. prfx .. date_time .. ".png")
gears.surface(snip_surf):write_to_png(fname)
if mg_onsuccess_cb then
mg_onsuccess_cb(fname) -- This should probably be a separate thread