Add the function of pressing Shift + hint key
Now, in revelation, press Shift + hint key to maximise the selected client. Press Shift + any key again to undo the maximisation.
This commit is contained in:
parent
e7576ce1f5
commit
f8363cbc74
35
init.lua
35
init.lua
|
@ -213,12 +213,45 @@ function revelation.expose(args)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local zoomed = false
|
||||||
|
local zoomedClient = nil
|
||||||
|
local keyPressed = false
|
||||||
|
|
||||||
capi.keygrabber.run(function (mod, key, event)
|
capi.keygrabber.run(function (mod, key, event)
|
||||||
|
local c = nil
|
||||||
|
local keyPressed = false
|
||||||
|
|
||||||
if event == "release" then return true end
|
if event == "release" then return true end
|
||||||
|
|
||||||
|
--if awful.util.table.hasitem(mod, "Shift") then
|
||||||
|
--debuginfo("dogx")
|
||||||
|
--debuginfo(string.lower(key))
|
||||||
|
--end
|
||||||
|
|
||||||
|
if awful.util.table.hasitem(mod, "Shift") then
|
||||||
|
if keyPressed then
|
||||||
|
keyPressed = false
|
||||||
|
else
|
||||||
|
c = hintindex[string.lower(key)]
|
||||||
|
if not zoomed and c ~= nil then
|
||||||
|
awful.tag.viewonly(zt[capi.mouse.screen], capi.mouse.screen)
|
||||||
|
awful.client.toggletag(zt[capi.mouse.screen], c)
|
||||||
|
zoomedClient = c
|
||||||
|
zoomed = true
|
||||||
|
elseif zoomedClient ~= nil then
|
||||||
|
awful.tag.history.restore(capi.mouse.screen)
|
||||||
|
awful.client.toggletag(zt[capi.mouse.screen], zoomedClient)
|
||||||
|
zoomedClient = nil
|
||||||
|
zoomed = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if hintindex[key] then
|
if hintindex[key] then
|
||||||
--client.focus = hintindex[key]
|
--client.focus = hintindex[key]
|
||||||
--hintindex[key]:raise()
|
--hintindex[key]:raise()
|
||||||
|
|
||||||
|
|
||||||
selectfn(restore)(hintindex[key])
|
selectfn(restore)(hintindex[key])
|
||||||
|
|
||||||
for i,j in pairs(hintindex) do
|
for i,j in pairs(hintindex) do
|
||||||
|
@ -242,8 +275,6 @@ function revelation.expose(args)
|
||||||
|
|
||||||
local pressedMiddle = false
|
local pressedMiddle = false
|
||||||
local pressedRight = false
|
local pressedRight = false
|
||||||
local zoomed = false
|
|
||||||
local zoomedClient = nil
|
|
||||||
|
|
||||||
capi.mousegrabber.run(function(mouse)
|
capi.mousegrabber.run(function(mouse)
|
||||||
local c = awful.mouse.client_under_pointer()
|
local c = awful.mouse.client_under_pointer()
|
||||||
|
|
Loading…
Reference in New Issue