mirror of
https://github.com/lcpz/awesome-copycats.git
synced 2024-12-23 03:32:30 +00:00
quake: replicated full scratchdrop behaviour
This commit is contained in:
parent
7bd82a18a8
commit
a9c5cf23b2
|
@ -20,6 +20,7 @@ local string = string
|
||||||
|
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
|
local tostring = tostring
|
||||||
|
|
||||||
module("quake")
|
module("quake")
|
||||||
|
|
||||||
|
@ -64,11 +65,11 @@ function QuakeConsole:display()
|
||||||
client.size_hints_honor = false
|
client.size_hints_honor = false
|
||||||
client:geometry(self.geometry)
|
client:geometry(self.geometry)
|
||||||
|
|
||||||
-- Sticky and on top
|
-- Not sticky and on top
|
||||||
client.ontop = true
|
client.ontop = true
|
||||||
client.above = true
|
client.above = true
|
||||||
client.skip_taskbar = true
|
client.skip_taskbar = true
|
||||||
client.sticky = true
|
client.sticky = false
|
||||||
|
|
||||||
-- This is not a normal window, don't apply any specific keyboard stuff
|
-- This is not a normal window, don't apply any specific keyboard stuff
|
||||||
client:buttons({})
|
client:buttons({})
|
||||||
|
@ -78,6 +79,7 @@ function QuakeConsole:display()
|
||||||
if self.visible then
|
if self.visible then
|
||||||
client.hidden = false
|
client.hidden = false
|
||||||
client:raise()
|
client:raise()
|
||||||
|
self.last_tag = tostring(awful.tag.selected(self.screen))
|
||||||
client:tags({awful.tag.selected(self.screen)})
|
client:tags({awful.tag.selected(self.screen)})
|
||||||
capi.client.focus = client
|
capi.client.focus = client
|
||||||
else
|
else
|
||||||
|
@ -89,6 +91,7 @@ function QuakeConsole:display()
|
||||||
client:tags(ctags)
|
client:tags(ctags)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return client
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Create a console
|
-- Create a console
|
||||||
|
@ -146,8 +149,13 @@ end
|
||||||
|
|
||||||
-- Toggle the console
|
-- Toggle the console
|
||||||
function QuakeConsole:toggle()
|
function QuakeConsole:toggle()
|
||||||
|
current_tag = awful.tag.selected(self.screen)
|
||||||
|
if self.last_tag ~= tostring(current_tag) and self.visible then
|
||||||
|
awful.client.movetotag(current_tag, self:display())
|
||||||
|
else
|
||||||
self.visible = not self.visible
|
self.visible = not self.visible
|
||||||
self:display()
|
self:display()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
setmetatable(_M, { __call = function(_, ...) return QuakeConsole:new(...) end })
|
setmetatable(_M, { __call = function(_, ...) return QuakeConsole:new(...) end })
|
||||||
|
|
Loading…
Reference in a new issue