mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-25 03:08:34 +02:00
bindings: add modkey + shift + print to screenshot a screen area
This commit is contained in:
parent
c0b7917c0a
commit
3f415e9530
1 changed files with 8 additions and 5 deletions
|
@ -5,14 +5,16 @@ local brightness = loadrc("brightness", "vbe/brightness")
|
||||||
local keydoc = loadrc("keydoc", "vbe/keydoc")
|
local keydoc = loadrc("keydoc", "vbe/keydoc")
|
||||||
|
|
||||||
local function screenshot(client)
|
local function screenshot(client)
|
||||||
if not client then
|
if client == "root" then
|
||||||
client = "root"
|
client = "-window root"
|
||||||
|
elseif client then
|
||||||
|
client = "-window " .. client.window
|
||||||
else
|
else
|
||||||
client = client.window
|
client = ""
|
||||||
end
|
end
|
||||||
local path = awful.util.getdir("config") .. "/screenshots/" ..
|
local path = awful.util.getdir("config") .. "/screenshots/" ..
|
||||||
"screenshot-" .. os.date("%Y-%m-%d--%H:%M:%S") .. ".jpg"
|
"screenshot-" .. os.date("%Y-%m-%d--%H:%M:%S") .. ".jpg"
|
||||||
awful.util.spawn("import -quality 95 -window " .. client .. " " .. path, false)
|
awful.util.spawn("import -quality 95 " .. client .. " " .. path, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -246,7 +248,8 @@ config.keys.global = awful.util.table.join(
|
||||||
"Spawn a terminal"),
|
"Spawn a terminal"),
|
||||||
|
|
||||||
-- Screenshot
|
-- Screenshot
|
||||||
awful.key({}, "Print", screenshot),
|
awful.key({}, "Print", function() screenshot("root") end),
|
||||||
|
awful.key({ modkey, "Shift" }, "Print", screenshot),
|
||||||
|
|
||||||
-- Restart awesome
|
-- Restart awesome
|
||||||
awful.key({ modkey, "Control" }, "r", awesome.restart),
|
awful.key({ modkey, "Control" }, "r", awesome.restart),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue