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, name, properties, volatile, switchto, force)
56 local c = clnt or client.focus
57 if not c then return end
59 local n = name or c.class
60 local p = (type(properties) == "table" and properties) or {}
61 local s = p.screen or c.screen
62 local t = module.add_tag(n, gears.table.join(p, {
69 function module.copy_tag()
70 local t = awful.screen.focused().selected_tag
71 if not t then return end
73 local clients = t:clients()
74 local t2 = awful.tag.add(t.name, awful.tag.getdata(t))
79 function module.collect_orphan_clients_to_tag(name)
81 for _,c in ipairs(client.get()) do
82 if #c:tags() == 0 then
83 orphans[#orphans+1] = c
87 naughty.notify({text="No orphan clients found."})
90 local t = awful.tag.find_by_name(nil, name)
92 t = module.add_tag("orphans", {
94 screen = awful.screen.focused(),
97 for _,c in ipairs(orphans) do