Skip to content

Commit

Permalink
Expose client properties table
Browse files Browse the repository at this point in the history
  • Loading branch information
ojv committed Mar 9, 2017
1 parent b44f863 commit 2730bd3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,26 @@ Both functions have this signature:

#### Client Window Properties

You can provide a table of properties for the client window, and functions
to call when the window is raised and lowered
To set [properties](https://awesomewm.org/apidoc/classes/client.html#Object_properties) for the client window (defaults shown):
```
conky.properties = {
floating = true,
sticky = true,
ontop = false,
skip_taskbar = true,
below = true,
focusable = true
}
```

You can also provide functions to call when the window is raised and lowered

```
conky.properties({ opacity = 0.4 })
conky.raise = function(c) c.opacity = 1.0 end
conky.lower = function(c) c.opacity = 0.4 end
````

## Conky Widgets
## Making Conky Widgets

Conky widget declaration:
```
Expand Down
29 changes: 11 additions & 18 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,18 @@ local widget = { -- for the widget that awesome draws
}
local updater = {} -- for updating the widget
local window = {} -- for conky's own window
local public = { config = {} } -- public interface


-- default conky client properties
local properties = {
floating = true,
sticky = true,
ontop = false,
skip_taskbar = true,
below = true,
focusable = false,
local public = { -- public interface
config = {}, -- canned widget configuration
properties = { -- client window properties
floating = true,
sticky = true,
ontop = false,
skip_taskbar = true,
below = true,
focusable = false,
}
}


-- PUBLIC INTERFACE -- {{{1
function public.widget(root) -- {{{2
-- builds the widget from nested tables
Expand Down Expand Up @@ -132,11 +130,6 @@ function public.toggle_key(key, mod) -- {{{2
{ description = "toggle conky window on top", group = "conky" })
end

function public.properties(t) -- {{{2
for prop, value in pairs(t) do
properties[prop] = value
end
end


-- WIDGET -- {{{1
Expand Down Expand Up @@ -280,7 +273,7 @@ awesome.connect_signal("startup",

function window.spawn() -- {{{2
awful.spawn(const("CONKY_LAUNCH"),
properties,
public.properties,
updater.send_string)
end

Expand Down

0 comments on commit 2730bd3

Please sign in to comment.