Add an option for the notification position. Update documentation.

This commit is contained in:
Manu Cornet 2021-12-25 09:34:55 +00:00
parent 9dc2a1fd72
commit 43db6a3449
2 changed files with 19 additions and 5 deletions

View File

@ -8,14 +8,26 @@ cd ~/.config/awesome
git clone https://github.com/lmanul/awesome-workspace-grid.git
```
Arguments to pass to the contructor (all of them are optional):
| Arg | Default | Description |
----------------------------------
| `rows` | 2 | Number of rows (1 to 9) |
| `columns` | 3 | Number of columns (1 to 9) |
| `position` | `"top_middle"` | Notification position on the screen |
| `visual` | `true` | Whether to show workspace changes |
----------------------------------
Please make sure that `rows` × `columns` is equal to your number of tags, as
defined by the call to `awful.tag()` in your configuration.
Sample usage in `rc.lua`:
```
local workspace_grid = require("awesome-workspace-grid")
grid = workspace_grid({
rows = 2, -- supported: 1 to 9
columns = 3, -- supported: 1 to 9
visual = true, -- whether to show workspace changes
rows = 3,
columns = 3,
})
-- Insert after 'globalkeys' is defined but before it is passed to 'root':

View File

@ -15,8 +15,10 @@ end
function workspace_grid:init(args)
self.rows = args.rows or 2
self.columns = args.columns or 3
self.position = args.position or "top_middle"
self.visual = args.visual or true
if args.visual then
if self.visual then
awful.screen.connect_for_each_screen(function(s)
s.workspace_notification_id = nil
end)
@ -80,7 +82,7 @@ function workspace_grid:on_tag_selected(t)
icon = script_path() .. icon_path,
icon_size = 100,
margin = 0,
position = "top_middle",
position = self.position,
preset = naughty.config.presets.normal,
replaces_id = s.workspace_notification_id,
screen = i,