Go to file
Drauthius 57b0bab65c Initial commit 2016-01-05 20:39:08 +01:00
doc Initial commit 2016-01-05 20:39:08 +01:00
MIT-LICENSE.txt Initial commit 2016-01-05 20:39:08 +01:00
README.md Initial commit 2016-01-05 20:39:08 +01:00
init.lua Initial commit 2016-01-05 20:39:08 +01:00
rc.lua.patch Initial commit 2016-01-05 20:39:08 +01:00

README.md

awesome-sharedtags

A simple implementation for creating tags shared on multiple screens for awesome window manager.

It is designed to work with awesome version 3.5, but might work with older or newer versions as well.

Features

  • Define a list of tags to be usable on all screens.
  • Move tags with all clients between screens.
  • Everything else should be just as usual.

Installation

  1. Clone or download a zip of the repository, and put the sharedtags directory somewhere where you can easily include it, for example in the same directory as your rc.lua file.
  2. Modify your rc.lua file. A patch against the default configuration is included in the repository for easy comparison, but keep reading for a textual description.
  3. Require the sharedtags library somewhere at the top of the file.
```lua
local sharedtags = require("sharedtags")
```
  1. Create the tags using the sharedtags() method, instead of the original ones created with awful.tag().
```lua
local tags = sharedtags(
    { name = "main", layout = layouts[2] },
    { name = "www", layout = awful.layout.suit.max },
    { name = "chat", screen = 2, layout = layouts[1] },
    { layout = layouts[2] },
    { screen = 2, layout = layouts[2] }
)
```
  1. The code for handling tags and clients needs to be changed to use the library.
```lua
for i = 1, 9 do
    globalkeys = awful.util.table.join(globalkeys,
        -- View tag only.
        awful.key({ modkey }, "#" .. i + 9,
            function ()
                local tag = tags[i]
                if tag then
                    sharedtags.viewonly(tag)
                end
            end),
        -- Toggle tag.
        awful.key({ modkey, "Control" }, "#" .. i + 9,
            function ()
                local tag = tags[i]
                if tag then
                    sharedtags.viewtoggle(tag)
                end
            end),
        -- Move client to tag.
        awful.key({ modkey, "Shift" }, "#" .. i + 9,
            function ()
                if client.focus then
                    local tag = tags[i]
                    if tag then
                        awful.client.movetotag(tag)
                    end
                end
            end),
        -- Toggle tag.
        awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
            function ()
                if client.focus then
                    local tag = tags[i]
                    if tag then
                        awful.client.toggletag(tag)
                    end
                end
            end))
end
```
  1. Lastly, since the tag list is now a one-dimensional array, any references to the tags array needs to be changed, for example in the rules section.
```lua
awful.rules.rules = {
    -- Set Firefox to always map on tag number 2.
    { rule = { class = "Firefox" },
      properties = { tag = tags[2] } },
}
```
  1. Restart or reload awesome.

Notes

Because of constraints in the X server, awesome does not allow toggling clients on tags allocated to other screens. Having a client on multiple tags and moving one of the tags will cause the client to move as well.

API

See doc/index.html for API documentation.

Credits

Idea originally from https://github.com/lammermann/awesome-configs, but I could not get that implementation to work.