Shared tags library for multiple monitors using AwesomeWM.
localcharitable=require("charitable")
-- Create tags and taglistlocaltaglist_buttons=gears.table.join(
awful.button({ }, 1, function(t) charitable.select_tag(t, awful.screen.focused()) end),
awful.button({ }, 3, function(t) charitable.toggle_tag(t, awful.screen.focused()) end)
)
localtags=charitable.create_tags(
{ "1", "2", "3", "4", "5", "6", "7", "8", "9" },
{
awful.layout.layouts[1],
awful.layout.layouts[1],
awful.layout.layouts[1],
awful.layout.layouts[1],
awful.layout.layouts[1],
awful.layout.layouts[1],
awful.layout.layouts[1],
awful.layout.layouts[1],
awful.layout.layouts[1],
}
)
awful.screen.connect_for_each_screen(function(s)
-- Show an unselected tag when a screen is connectedfori=1, #tagsdoifnottags[i].selectedthentags[i].screen=stags[i]:view_only()
breakendends.mytaglist=awful.widget.taglist({
screen=s,
filter=awful.widget.taglist.filter.all,
buttons=taglist_buttons,
source=function(screen, args) returntagsend,
})
-- ...end-- Keys setupfori=1, 9doglobalkeys=gears.table.join(globalkeys,
-- View tag only.awful.key({ modkey }, "#" ..i+9,
function () charitable.select_tag(tags[i], awful.screen.focused()) end,
{description="view tag #"..i, group="tag"}),
-- Toggle tag display.awful.key({ modkey, "Control" }, "#" ..i+9,
function () charitable.toggle_tag(tags[i], awful.screen.focused()) end,
{description="toggle tag #" ..i, group="tag"}),
-- Move client to tag.awful.key({ modkey, "Shift" }, "#" ..i+9,
function ()
ifclient.focusthenlocaltag=tags[i]
iftagthenclient.focus:move_to_tag(tag)
endendend,
{description="move focused client to tag #"..i, group="tag"}),
-- Toggle tag on focused client.awful.key({ modkey, "Control", "Shift" }, "#" ..i+9,
function ()
ifclient.focusthenlocaltag=tags[i]
iftagthenclient.focus:toggle_tag(tag)
endendend,
{description="toggle focused client on tag #" ..i, group="tag"})
)
end-- ensure that removing screens doesn't kill tagstag.connect_signal("request::screen", function(t)
t.selected=falseforsinscreendoifs~=t.screenthent.screen=sreturnendendend)
-- work around bugs in awesome 4.0 through 4.3+-- see https://github.com/awesomeWM/awesome/issues/2780awful.tag.history.restore=function() endTypical AwesomeWM configuration implies that tags are per screen. This library allows AwesomeWM to instead have tags that are shared across all connected screens. This is how XMonad works by default.
charitable.create_tagsreplacesawful.tag.newcharitable.select_tagreplacest:view_only()charitable.toggle_tagreplacesawful.tag.viewtogglecharitable.tag_moveis newcharitable.swap_screenis new
This was originally implemented by Benjamin Kober, and later forked and updated by Alexey Solodkiy. This version has been updated to support AwesomeWM 4.x, and have a better name.