Add an option for the notification position. Update documentation.
This commit is contained in:
parent
9dc2a1fd72
commit
43db6a3449
18
README.md
18
README.md
|
@ -8,14 +8,26 @@ cd ~/.config/awesome
|
||||||
git clone https://github.com/lmanul/awesome-workspace-grid.git
|
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`:
|
Sample usage in `rc.lua`:
|
||||||
|
|
||||||
```
|
```
|
||||||
local workspace_grid = require("awesome-workspace-grid")
|
local workspace_grid = require("awesome-workspace-grid")
|
||||||
grid = workspace_grid({
|
grid = workspace_grid({
|
||||||
rows = 2, -- supported: 1 to 9
|
rows = 3,
|
||||||
columns = 3, -- supported: 1 to 9
|
columns = 3,
|
||||||
visual = true, -- whether to show workspace changes
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Insert after 'globalkeys' is defined but before it is passed to 'root':
|
-- Insert after 'globalkeys' is defined but before it is passed to 'root':
|
||||||
|
|
|
@ -15,8 +15,10 @@ end
|
||||||
function workspace_grid:init(args)
|
function workspace_grid:init(args)
|
||||||
self.rows = args.rows or 2
|
self.rows = args.rows or 2
|
||||||
self.columns = args.columns or 3
|
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)
|
awful.screen.connect_for_each_screen(function(s)
|
||||||
s.workspace_notification_id = nil
|
s.workspace_notification_id = nil
|
||||||
end)
|
end)
|
||||||
|
@ -80,7 +82,7 @@ function workspace_grid:on_tag_selected(t)
|
||||||
icon = script_path() .. icon_path,
|
icon = script_path() .. icon_path,
|
||||||
icon_size = 100,
|
icon_size = 100,
|
||||||
margin = 0,
|
margin = 0,
|
||||||
position = "top_middle",
|
position = self.position,
|
||||||
preset = naughty.config.presets.normal,
|
preset = naughty.config.presets.normal,
|
||||||
replaces_id = s.workspace_notification_id,
|
replaces_id = s.workspace_notification_id,
|
||||||
screen = i,
|
screen = i,
|
||||||
|
|
Loading…
Reference in New Issue