All Projects → Drauthius → awesome-sharedtags

Drauthius / awesome-sharedtags

Licence: MIT License
Share and move tags on multiple screens when using the awesome window manager.

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to awesome-sharedtags

awesome
my Awesome(window management) configuration for Arch/Ubuntu
Stars: ✭ 34 (-49.25%)
Mutual labels:  awesomewm
dotfiles
pls help
Stars: ✭ 301 (+349.25%)
Mutual labels:  awesomewm
dotfiles
My awesomewm dotfiles for awesome people! ✨
Stars: ✭ 1,764 (+2532.84%)
Mutual labels:  awesomewm
dotfiles
Linux configuration files (dotfiles) and some useful scripts
Stars: ✭ 22 (-67.16%)
Mutual labels:  awesomewm
dotfiles
Config files for my setup
Stars: ✭ 289 (+331.34%)
Mutual labels:  awesomewm
dotfiles
🏠 ~/
Stars: ✭ 19 (-71.64%)
Mutual labels:  awesomewm
dotfiles
My NixOS configuration featuring awesome and neovim
Stars: ✭ 40 (-40.3%)
Mutual labels:  awesomewm
awesome-modalbind
Modal keybindings for awesomewm
Stars: ✭ 24 (-64.18%)
Mutual labels:  awesomewm
awesome-power widget
A Power widget for the Awesome Window Manager
Stars: ✭ 25 (-62.69%)
Mutual labels:  awesomewm
keyboard layout
Keyboard switcher for Awesome WM with additional layouts
Stars: ✭ 48 (-28.36%)
Mutual labels:  awesomewm
dotfiles
These are my dotfiles. All the config stuff that I use is here.
Stars: ✭ 16 (-76.12%)
Mutual labels:  awesomewm
awesome-config
My awesome wm configuration.
Stars: ✭ 27 (-59.7%)
Mutual labels:  awesomewm
nixdots
I have no idea what the hell I'm doing
Stars: ✭ 46 (-31.34%)
Mutual labels:  awesomewm
awesome-switcher
Switch clients in Awesome WM with the familiar preview functionality
Stars: ✭ 86 (+28.36%)
Mutual labels:  awesomewm
blind
An pack of advanced themes for Awesome WM
Stars: ✭ 34 (-49.25%)
Mutual labels:  awesomewm
autohidewibox
Execute awesome wm commands on ModKey press/release
Stars: ✭ 18 (-73.13%)
Mutual labels:  awesomewm
smart borders
awesomewm full titlebar functionality without sacrificing space
Stars: ✭ 51 (-23.88%)
Mutual labels:  awesomewm
awesome
Configs for awesomeWM
Stars: ✭ 42 (-37.31%)
Mutual labels:  awesomewm
dotfiles
dotfiles for the command line home
Stars: ✭ 21 (-68.66%)
Mutual labels:  awesomewm
dots
Use chezmoi to install my dotfiles easily on Gentoo, Arch, Void and Debian.
Stars: ✭ 70 (+4.48%)
Mutual labels:  awesomewm

awesome-sharedtags

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

This branch of the library is intended to work with awesome version 4 (for all minor versions), but there are other branches with support for other versions.

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, generally located in ~/.config/awesome/.
  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.
    1. Require the sharedtags library somewhere at the top of the file.
      local sharedtags = require("sharedtags")
    2. Create the tags using the sharedtags() method, instead of the original ones created with awful.tag(). They should be created at the file level, i.e. outside of any function.
      local tags = sharedtags({
          { name = "main", layout = awful.layout.layouts[2] },
          { name = "www", layout = awful.layout.layouts[10] },
          { name = "game", layout = awful.layout.layouts[1] },
          { name = "misc", layout = awful.layout.layouts[2] },
          { name = "chat", screen = 2, layout = awful.layout.layouts[2] },
          { layout = awful.layout.layouts[2] },
          { screen = 2, layout = awful.layout.layouts[2] }
      })
    3. Remove or uncomment the code which creates the tags when a screen is connected, in the connect_for_each_screen callback.
      awful.screen.connect_for_each_screen(function(s)
          -- Each screen has its own tag table.
          --awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
      
          -- Here is a good place to add tags to a newly connected screen, if desired:
          --sharedtags.viewonly(tags[4], s)
      end)
    4. The code for handling tags and clients needs to be changed to use the library and pick the correct tag.
      for i = 1, 9 do
          globalkeys = gears.table.join(globalkeys,
              -- View tag only.
              awful.key({ modkey }, "#" .. i + 9,
                        function ()
                              local screen = awful.screen.focused()
                              local tag = tags[i]
                              if tag then
                                 sharedtags.viewonly(tag, screen)
                              end
                        end,
                        {description = "view tag #"..i, group = "tag"}),
              -- Toggle tag display.
              awful.key({ modkey, "Control" }, "#" .. i + 9,
                        function ()
                            local screen = awful.screen.focused()
                            local tag = tags[i]
                            if tag then
                               sharedtags.viewtoggle(tag, screen)
                            end
                        end,
                        {description = "toggle tag #" .. i, group = "tag"}),
              -- Move client to tag.
              awful.key({ modkey, "Shift" }, "#" .. i + 9,
                        function ()
                            if client.focus then
                                local tag = tags[i]
                                if tag then
                                    client.focus:move_to_tag(tag)
                                end
                           end
                        end,
                        {description = "move focused client to tag #"..i, group = "tag"}),
              -- Toggle tag on focused client.
              awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
                        function ()
                            if client.focus then
                                local tag = tags[i]
                                if tag then
                                    client.focus:toggle_tag(tag)
                                end
                            end
                        end,
                        {description = "toggle focused client on tag #" .. i, group = "tag"})
          )
      end
    5. Lastly, any rules referencing the screen and tag should use the newly created tags array instead.
      awful.rules.rules = {
          -- Set Firefox to always map on tag number 2.
          { rule = { class = "Firefox" },
            properties = { tag = tags[2] } }, -- or tags["www"] to map it to the name instead
      }
  3. Restart or reload awesome.

Notes

  1. There is a bug in awesome v4.0 which can cause all tags to be deselected when moving a tag to another screen. The following patch can be used to fix the problem.
    diff --git a/lib/awful/tag.lua b/lib/awful/tag.lua
    index 66bd0c1..b481f42 100644
    --- a/lib/awful/tag.lua
    +++ b/lib/awful/tag.lua
    @@ -475,7 +475,7 @@ end
     function tag.object.set_screen(t, s)
     
         s = get_screen(s or ascreen.focused())
    -    local sel = tag.selected
    +    local sel = t.selected
         local old_screen = get_screen(tag.getproperty(t, "screen"))
     
         if s == old_screen then return end
    The file is located under /usr/share/awesome/lib/awful/tag.lua on my system.
  2. 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].