-
--[[
-
- Lain
- Layouts, widgets and utilities for Awesome WM
-
- Utilities section
-
- Licensed under GNU General Public License v2
- * (c) 2013, Luke Bonham
- * (c) 2010-2012, Peter Hofmann
-
+
+ Lain
+ Layouts, widgets and utilities for Awesome WM
+
+ Utilities section
+
+ Licensed under GNU General Public License v2
+ * (c) 2013, Luca CPZ
+ * (c) 2010-2012, Peter Hofmann
+
--]]
local awful = require("awful")
end
end
--- https://github.com/copycat-killer/lain/issues/195
+-- https://github.com/lcpz/lain/issues/195
function util.mc(c, width_f, height_f)
c = c or util.magnified_client
if not c then return end
-- {{{ Dynamic tagging
-- Add a new tag
-function util.add_tag()
+function util.add_tag(layout)
awful.prompt.run {
prompt = "New tag name: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = function(name)
if not name or #name == 0 then return end
- awful.tag.add(name, { screen = awful.screen.focused() }):view_only()
+ awful.tag.add(name, { screen = awful.screen.focused(), layout = layout or awful.layout.suit.tile }):view_only()
end
}
end
-- }}}
-- On the fly useless gaps change
-function util.useless_gaps_resize(thatmuch)
- local scr = awful.screen.focused()
- scr.selected_tag.gap = scr.selected_tag.gap + tonumber(thatmuch)
+function util.useless_gaps_resize(thatmuch, s, t)
+ local scr = s or awful.screen.focused()
+ local tag = t or scr.selected_tag
+ tag.gap = tag.gap + tonumber(thatmuch)
awful.layout.arrange(scr)
end