1 -- Goes to the frame in the specified direction. If there is no frame in the
2 -- given direction, it goes to the next workspace in the direction, being:
3 -- left = previous workspace
4 -- right = next workspace
6 -- By Rene van Bevern <rvb@pro-linux.de>, 2005
9 -- If you are about to go to a frame that would be left to the leftmost frame,
10 -- the function switches to a previous workspace and goes to its rightmost frame.
11 -- If you are about to go to a frame that would be right of the rightmost frame,
12 -- the function switches to the next workspace and goes to its leftmost frame.
14 -- To use this function you need to bind keys for WIonWS, for exmaple:
16 --defbindings("WIonWS", {
17 -- kpress(MOD1.."Up", "go_frame_or_desk_up(_)"),
18 -- kpress(MOD1.."Down", "go_frame_or_desk_down(_)"),
19 -- kpress(MOD1.."Right", "go_frame_or_desk_right(_)"),
20 -- kpress(MOD1.."Left", "go_frame_or_desk_left(_)"),
23 function go_frame_or_desk(workspace
, direction
)
24 local region
= workspace
:current()
25 local screen
= workspace
:screen_of()
26 if workspace
:nextto(region
,direction
,false) then
27 workspace
:goto_dir(direction
)
28 elseif direction
== "left" then
30 screen
:current():farthest("right"):goto()
31 elseif direction
== "right" then
33 screen
:current():farthest("left"):goto()
37 function go_frame_or_desk_left(reg
)
38 go_frame_or_desk(reg
, "left")
41 function go_frame_or_desk_right(reg
)
42 go_frame_or_desk(reg
, "right")
45 function go_frame_or_desk_up(reg
)
46 go_frame_or_desk(reg
, "up")
49 function go_frame_or_desk_down(reg
)
50 go_frame_or_desk(reg
, "down")