[UP] change date to first within ion3, add taigon_binfa.
[arrow.git] / archlinux_conf / etc / ion3 / go_frame_or_desk.lua
bloba9b15c979dfd95287ad664b25895afb180576d78
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
5 --
6 -- By Rene van Bevern <rvb@pro-linux.de>, 2005
7 -- Public Domain
8 --
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(_)"),
21 --})
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
29 screen:switch_prev()
30 screen:current():farthest("right"):goto()
31 elseif direction == "right" then
32 screen:switch_next()
33 screen:current():farthest("left"):goto()
34 end
35 end
37 function go_frame_or_desk_left(reg)
38 go_frame_or_desk(reg, "left")
39 end
41 function go_frame_or_desk_right(reg)
42 go_frame_or_desk(reg, "right")
43 end
45 function go_frame_or_desk_up(reg)
46 go_frame_or_desk(reg, "up")
47 end
49 function go_frame_or_desk_down(reg)
50 go_frame_or_desk(reg, "down")
51 end