Added lock screen keybind

master
Mark 2021-11-28 19:49:38 -08:00
parent 44eb4336e7
commit 1ab6b4f51d
5 changed files with 49 additions and 0 deletions

View File

@ -10,6 +10,16 @@ return {
elseif (string.lower(confirm_prompt) == "r") or (string.lower(confirm_prompt) == "reset") then
awful.spawn("shutdown -r now", false)
end
end,
lock = function()
local n = naughty.notify({
title = "Locking screen",
text = "...",
timeout = 1
})
awful.spawn(script_dir .. "lock " .. beautiful.icons.lockicon, false)
end
},

13
bin/scripts/lock Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
icon=$1
tmpbg="/tmp/lockscreen.png"
tmpic="/tmp/lockscreenicon.png"
#(( $# )) && { icon=$1; }
scrot --overwrite "$tmpbg"
convert "$icon" -scale 25% "$tmpic"
convert "$tmpbg" -scale 10% -scale 1000% "$tmpbg"
convert "$tmpbg" "$tmpic" -gravity center -composite -matte "$tmpbg"
i3lock -u -i "$tmpbg"

View File

@ -11,5 +11,28 @@ return gears.table.join(
description = "Shutdown",
group = "System"
}
),
awful.key( {"Mod4"}, "a",
function ()
bin.system.lock()
end,
{
description = "Lock screen",
group = "System"
}
),
awful.key( {"Mod4", "Control"}, "x",
function ()
-- requires sudoers rule
awful.spawn("sudo systemctl restart lightdm")
end,
{
description = "Restart lightdm",
group = "System"
}
)
)

View File

@ -9,6 +9,9 @@ return {
submenu = conf.icon_dir .. "submenu.svg",
launcher = conf.icon_dir .. "arch.svg",
-- must be a png for i3lock
lockicon = conf.icon_dir .. "arch.png",
music = {
grey = {
play = conf.icon_dir .. "music/play-grey.svg",

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB