From 6fc4556eed9be4de6d5871780e5202da588cb870 Mon Sep 17 00:00:00 2001 From: Von Random Date: Sat, 21 Mar 2015 01:09:34 +0300 Subject: [PATCH] =?UTF-8?q?now=20it=20is=20possible=20to=20use=20the=20hot?= =?UTF-8?q?key=20used=20to=20switch=20to=20specific=20tag=20to=20go=20back?= =?UTF-8?q?=20to=20previous=20one=20=C3=A0=20la=20weechat=20+=20finally=20?= =?UTF-8?q?fixed=20floating=20window=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rc.lua | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/rc.lua b/rc.lua index 432e696..29792aa 100644 --- a/rc.lua +++ b/rc.lua @@ -140,7 +140,7 @@ tags = {} saved_layouts = {} for s = 1, screen.count() do tags[s] = { name = {}, layout = {} } - saved_layouts[s] = { tiled = {}, float = {} } + saved_layouts[s] = { tiled = {} } end -- screen 1 --tags[1].name = { @@ -494,7 +494,11 @@ for i = 1, 9 do local screen = mouse.screen local tag = awful.tag.gettags(screen)[i] if tag then - awful.tag.viewonly(tag) + if awful.tag.selected(screen) == tag and awful.tag.selectedlist(screen)[2] == nil then + awful.tag.history.restore() + else + awful.tag.viewonly(tag) + end end end), awful.key({ modkey, 'Control' }, '#' .. i + 9, @@ -706,7 +710,7 @@ tag.connect_signal( function(t) for k, c in ipairs(t:clients()) do if awful.layout.get(mouse.screen) == awful.layout.suit.floating then - c:geometry(saved_layouts[c.screen].float[c.window]) + c:geometry(awful.client.property.get(c, 'floating_geometry')) end end end @@ -716,27 +720,16 @@ client.connect_signal( 'manage', function(c) if awful.layout.get(mouse.screen) == awful.layout.suit.floating then - saved_layouts[c.screen].float[c.window] = c:geometry() + awful.client.property.set(c, 'floating_geometry', c:geometry()) end end ) -client.connect_signal('unmanage', function(c) saved_layouts[c.screen].float[c.window] = nil end) - client.connect_signal( 'property::geometry', function(c) - if awful.layout.get(mouse.screen) == awful.layout.suit.floating and awful.client.floating.get(c) == false then - saved_layouts[c.screen].float[c.window] = c:geometry() - end - end -) - -client.connect_signal( - 'property::floating', - function(c) - if awful.client.floating.get(c) == false and saved_layouts[c.screen].float[c.window] ~= nil then - c:geometry(saved_layouts[c.screen].float[c.window]) + if awful.layout.get(mouse.screen) == awful.layout.suit.floating then + awful.client.property.set(c, 'floating_geometry', c:geometry()) end end )