All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 local awful = require('awful')
5 function module.delete_tag()
6 local t = awful.screen.focused().selected_tag
7 if not t then return end
12 function module.add_tag(name, properties, switchto, force)
13 local p = (type(properties) == "table" and properties) or {}
15 name = name or string.format("t%d", tmpcounter)
16 tmpcounter = tmpcounter + 1
18 if not awful.tag.find_by_name(p.screen, name) or force then
20 or (client.focus and client.focus.screen)
21 or awful.screen.focused())
22 local t = awful.tag.add(name, p)
28 local text = "A tag with name \"" .. name .. "\" already exists"
30 text = text .. " (on screen " .. p.screen.name .. ")"
33 preset = naughty.config.presets.low,
34 title = "Add a new tag",
40 function module.rename_tag()
42 prompt = "New tag name: ",
43 textbox = awful.screen.focused().mypromptbox.widget,
44 exe_callback = function(new_name)
45 if not new_name or #new_name == 0 then return end
47 local t = awful.screen.focused().selected_tag
55 function module.move_to_new_tag(clnt, properties, volatile, switchto, force)
56 local c = clnt or client.focus
57 if not c then return end
59 local p = (type(properties) == "table" and properties) or {}
60 local s = p.screen or c.screen
61 local t = module.add_tag(c.class, gears.table.join(p, {
68 function module.copy_tag()
69 local t = awful.screen.focused().selected_tag
70 if not t then return end
72 local clients = t:clients()
73 local t2 = awful.tag.add(t.name, awful.tag.getdata(t))
78 function module.collect_orphan_clients_to_tag(name)
80 for _,c in ipairs(client.get()) do
81 if #c:tags() == 0 then
82 orphans[#orphans+1] = c
86 naughty.notify({text="No orphan clients found."})
89 local t = awful.tag.find_by_name(nil, name)
91 t = module.add_tag("orphans", {
93 screen = awful.screen.focused(),
96 for _,c in ipairs(orphans) do