diff --git a/config/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.lua b/config/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.lua index 0e7218da9..4a19021a5 100644 --- a/config/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.lua +++ b/config/awesome/awesome-wm-widgets/logout-menu-widget/logout-menu.lua @@ -52,13 +52,14 @@ local function worker(user_args) local font = args.font or beautiful.font local onlogout = args.onlogout or function () awesome.quit() end + local onlock = args.onlock or function() awful.spawn.with_shell("betterlockscreen -l") end local onreboot = args.onreboot or function() awful.spawn.with_shell("reboot") end local onsuspend = args.onsuspend or function() awful.spawn.with_shell("systemctl suspend") end local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("poweroff") end local menu_items = { { name = 'Log out', icon_name = 'log-out.svg', command = onlogout }, --- { name = 'Lock', icon_name = 'lock.svg', command = onlock }, + { name = 'Lock', icon_name = 'lock.svg', command = onlock }, { name = 'Reboot', icon_name = 'refresh-cw.svg', command = onreboot }, { name = 'Suspend', icon_name = 'moon.svg', command = onsuspend }, { name = 'Power off', icon_name = 'power.svg', command = onpoweroff }, diff --git a/config/awesome/config.org b/config/awesome/config.org index 05255b866..5dbb7565d 100644 --- a/config/awesome/config.org +++ b/config/awesome/config.org @@ -164,6 +164,7 @@ local chat1 = "element-desktop" local chat2 = "whatsapp-for-linux" local notes = "joplin-desktop" local passwords = "bitwarden-desktop" +local screenlocker = "betterlockscreen -l" -- Key bindings variables local modkey = "Mod4" @@ -413,6 +414,10 @@ globalkeys = my_table.join( awful.key({ modkey }, "p", function() awful.util.spawn("arandr") end, {description = "launch screen configuration tool", group = ("screen")}), +-- Screen Lock + awful.key({ modkey }, "l", function() awful.spawn(screenlocker) end, + {description = "lock the screen", group = "screen"}), + -- Show/Hide Wibox awful.key({ modkey }, "b", function () for s in screen do diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index 0237259c8..37176bb3b 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -107,6 +107,7 @@ local chat1 = "element-desktop" local chat2 = "whatsapp-for-linux" local notes = "joplin-desktop" local passwords = "bitwarden-desktop" +local screenlocker = "betterlockscreen -l" -- Key bindings variables local modkey = "Mod4" @@ -328,6 +329,10 @@ globalkeys = my_table.join( awful.key({ modkey }, "p", function() awful.util.spawn("arandr") end, {description = "launch screen configuration tool", group = ("screen")}), +-- Screen Lock + awful.key({ modkey }, "l", function() awful.spawn(screenlocker) end, + {description = "lock the screen", group = "screen"}), + -- Show/Hide Wibox awful.key({ modkey }, "b", function () for s in screen do