From c498b857de9c234649d4a7601101a025178bf9d0 Mon Sep 17 00:00:00 2001 From: Clay Gomera Date: Tue, 4 Jan 2022 22:26:40 -0400 Subject: [PATCH] fixed --- .../awesome-wm-widgets/logout-menu-widget/logout-menu.lua | 3 ++- config/awesome/config.org | 5 +++++ config/awesome/rc.lua | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) 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