diff options
Diffstat (limited to 'utils.lua')
-rw-r--r-- | utils.lua | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -1,6 +1,7 @@ local M = {} local awful = require("awful") +local naughty = require("naughty") -- mapping from logical screen indices to indices corresponding to their -- physical layout @@ -43,4 +44,17 @@ function M.spawn_current(command) awful.spawn(command, {tag = mouse.screen.selected_tag}) end +function M.screen_lock() + awful.spawn.easy_async("xscreensaver-command -lock", + function(stdout, stderr, exitreason, exitcode) + if exitcode ~= 0 then + naughty.notify({ preset = naughty.config.presets.critical, + title = "Error locking the screen", + text = table.concat({stdout, stderr}, "\n") }) + + end + end) + +end + return M |