On Fri, 10 Jun 2016 21:24:28 +0200 Jeroen Budts <jer...@budts.be> wrote:
> Hi all, > > After using the default (?) maximize keybinding for a while I would > rather prefer it that modkey+m would simpley switch to the maximized > layout to immediately maximize all clients and avoid some weird > behaviour I sometimes see with maximized clients (they are sometimes > behind other clients right after maximizing). I guess this should be > doable using awful.layout.set('awful.layout.suit.max'). > However when pressing modkey+m again, I'd like to switch back to the > previous layout for the tag, similar to the regular modkey+m > keybinding. I'm not entirely sure how to do this. I could store the > layout for the current tag in a table right before switching to the > max layout and lookup the previous layout in the table when restoring > from it. Has anyone done something like this already? Maybe it's just > a crazy idea... > > Kind regards, > Jeroen > Seems simple enough local layout_history = {} local max_layout_switch = function() local cl = awful.layout.get() local ct = awful.tag.selected() if cl == awful.layout.suit.max then if layout_history[ct] then awful.layout.set(layout_history[ct]) layout_history[ct] = nil end else layout_history[ct] = cl awful.layout.set(awful.layout.suit.max) end end -- To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.