1 ---------------------------------------------------------------------------
2 -- @author Julien Danjou <julien@danjou.info>
3 -- @copyright 2008 Julien Danjou
4 -- @release @AWESOME_VERSION@
5 ---------------------------------------------------------------------------
7 -- Grab environment we need
14 local util
= require("awful.util")
15 local client
= require("awful.client")
17 --- Screen module for awful
18 module("awful.screen")
23 --- Give the focus to a screen, and move pointer.
24 -- @param screen Screen number.
25 function focus(screen
)
26 if screen
> capi
.screen
.count() then screen
= capi
.mouse
.screen
end
27 local c
= client
.focus
.history
.get(screen
, 0)
28 if c
then capi
.client
.focus
= c
end
29 -- Move the mouse on the screen
30 capi
.mouse
.screen
= screen
33 --- Give the focus to a screen, and move pointer, but relative to the current
35 -- @param i Value to add to the current focused screen index. 1 will focus next
36 -- screen, -1 would focus the previous one.
37 function focus_relative(i
)
38 return focus(util
.cycle(capi
.screen
.count(), capi
.mouse
.screen
+ i
))
41 --- Get or set the screen padding.
42 -- @param screen The screen object to change the padding on
43 -- @param padding The padding, an table with 'top', 'left', 'right' and/or
44 -- 'bottom'. Can be nil if you only want to retrieve padding
45 function padding(screen
, padding
)
47 data
.padding
[screen
] = padding
48 screen
:emit_signal("padding")
50 return data
.padding
[screen
]
53 -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80