Add sample usage in README

This commit is contained in:
Manu Cornet 2021-12-14 08:18:08 +00:00
parent 0cbfb26bbf
commit 107bcdfced
2 changed files with 25 additions and 3 deletions

View File

@ -1 +1,23 @@
# awesome-workspace-grid
# awesome-workspace-grid
Sample usage:
```
local workspace_grid = require("awesome-workspace-grid")
grid = workspace_grid({
rows = rows, -- only 2 supported for now!
columns = columns, -- only 3 supported for now!
visual = true,
})
globalkeys = gears.table.join(globalkeys,
awful.key(tag_nav_mod_keys, "Up",
function () grid:navigate("up") end, {description = "Up", group="Tag"}),
awful.key(tag_nav_mod_keys, "Down",
function () grid:navigate("down") end, {description = "Down", group="Tag"}),
awful.key(tag_nav_mod_keys, "Left",
function () grid:navigate("left") end, {description = "Left", group="Tag"}),
awful.key(tag_nav_mod_keys, "Right",
function () grid:navigate("right") end, {description = "Right", group="Tag"}),
)
```

View File

@ -34,8 +34,8 @@ function workspace_grid:new(args)
end
function workspace_grid:init(args)
self.rows = args.rows
self.columns = args.columns
self.rows = args.rows or 2
self.columns = args.columns or 3
if args.visual then
awful.screen.connect_for_each_screen(function(s)