docs: Update for awesome 4.0 changes

s is now a screen object.

Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
This commit is contained in:
Jonathan McCrohan 2017-02-20 23:10:47 +00:00 committed by Yauhen Kirylau
parent 3a701f83e5
commit 052cda939b

View file

@ -33,17 +33,19 @@ configurable rules.
### A simple layout ### A simple layout
* Display `my_first_widget` only on screen one * Display `my_first_widget` only on primary screen
* Add a background color to `my_third_widget` * Display `my_second_widget` only on screen two
* Add a background color to `my_fourth_widget`
* Dispose in a `wibox.layout.fixed.horizontal` layout * Dispose in a `wibox.layout.fixed.horizontal` layout
Code: Code:
s.mywibox : setup { s.mywibox : setup {
s == 1 and my_first_widget, -- Only display on screen 1 s == screen.primary and my_first_widget, -- Only display on primary screen
my_second_widget, s.index == 2 and my_second_widget, -- Only display on screen 2
{ -- Add a background color/pattern for my_third_widget my_third_widget, -- Displayed on all screens
my_third_widget, { -- Add a background color/pattern for my_fourth_widget
my_fourth_widget,
bg = beautiful.bg_focus, bg = beautiful.bg_focus,
widget = wibox.container.background, widget = wibox.container.background,
}, },
@ -51,9 +53,9 @@ Code:
} }
In this example `s == 1` is an inline expression. In the default `rc.lua`, In this example `s == screen.primary` is an inline expression. In the default
there is an `s` variable represent to define the current screen. Any Lua `rc.lua`, there is an `s` variable represent to define the current screen. Any
logic expression can be used as long as it returns a valid widget or a Lua logic expression can be used as long as it returns a valid widget or a
declarative layout, or `nil`. declarative layout, or `nil`.
### Composite widgets ### Composite widgets