Fixed formatting
This commit is contained in:
parent
f18fbbd44a
commit
f30c75a161
134
README.md
134
README.md
|
@ -24,73 +24,73 @@ Installation
|
|||
2. Modify your `rc.lua` file. A [patch](rc.lua.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.
|
||||
```lua
|
||||
local sharedtags = require("sharedtags")
|
||||
```
|
||||
2. 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] }
|
||||
)
|
||||
```
|
||||
3. 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
|
||||
```
|
||||
4. 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] } }, -- or tags["www"] to map it to the name instead
|
||||
}
|
||||
```
|
||||
1. Require the `sharedtags` library somewhere at the top of the file.
|
||||
```lua
|
||||
local sharedtags = require("sharedtags")
|
||||
```
|
||||
2. 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] }
|
||||
)
|
||||
```
|
||||
3. 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
|
||||
```
|
||||
4. 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] } }, -- or tags["www"] to map it to the name instead
|
||||
}
|
||||
```
|
||||
3. Restart or reload *awesome*.
|
||||
|
||||
Notes
|
||||
|
|
Loading…
Reference in New Issue