Drop obsolete muttng from /etc/skel/.fluxbox/menu and /etc/skel/.pekwm/menu, thanks...
[grml-desktop.git] / etc / skel / .ion2 / go_frame_or_desk.lua
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 2004, Rene van Bevern <rvb@pro-linux.de>
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.
13 --
14 -- To use this function you need to bind keys in the ionws_bindings
15 --
16 -- ionws_bindings {
17 --    kpress(DEFAULT_MOD.."Down", function(f) go_frame_or_desk(f, "down") end),
18 --    kpress(DEFAULT_MOD.."Up", function(f) go_frame_or_desk(f, "up") end),
19 --    kpress(DEFAULT_MOD.."Right", function(f) go_frame_or_desk(f, "right") end),
20 --    kpress(DEFAULT_MOD.."Left", function(f) go_frame_or_desk(f, "left") end)
21 -- }
22
23 function go_frame_or_desk(ws, dir)
24         local reg = ws:current()
25         local scr = ws:screen_of()
26         if ws:next_to(reg,dir)  then ws:goto_dir(dir)
27         elseif dir == "left"    then
28                 scr:switch_prev()
29                 WRegion.goto(scr:current():rightmost())
30         elseif dir == "right"   then
31                 scr:switch_next()
32                 WRegion.goto(scr:current():leftmost())
33         end
34 end
35
36 function go_frame_or_desk_left(reg)
37         go_frame_or_desk(reg, "left")
38 end
39
40 function go_frame_or_desk_right(reg)
41         go_frame_or_desk(reg, "right")
42 end
43
44 function go_frame_or_desk_up(reg)
45         go_frame_or_desk(reg, "up")
46 end
47
48 function go_frame_or_desk_down(reg)
49         go_frame_or_desk(reg, "down")
50 end