Added lock screen keybind
This commit is contained in:
10
bin/init.lua
10
bin/init.lua
@ -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
13
bin/scripts/lock
Executable 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"
|
Reference in New Issue
Block a user