[UP] use ion3-plus haha.
[arrow.git] / archlinux_conf / etc / ion3 / old / cfg_mouse.lua
blob3f0aac09d93bc2fe1423f0e51af725da0b7d5592
1 -- cfg_mouse.lua
2 --
3 -- (Canaan Hadley-Voth)
4 --
5 -- A set of bindings intended to make the mouse pull its weight.
6 -- Fluxbox users should feel right at home. This will be less
7 -- useful without a mouse wheel, but still worth considering.
8 --
9 -- Partly it's an experiment to see how far one can get
10 -- without using a keyboard in a window manager geared
11 -- toward keyboard users. But there's nothing inherently
12 -- anti-mouse about Ion, and with minor adjustments I find it
13 -- extremely capable.
15 -- To use, add to cfg_ion.lua: dopath("cfg_mouse")
17 defbindings("WScreen", {
19 -- Switching workspaces can be done from anywhere using Mod1 and
20 -- the wheel, or without the keyboard by using the wheel over
21 -- the left, right or bottom edges of the screen, or over a border
22 -- or an empty frame.
24 -- (Although a couple of the looks don't have any space at edges
25 -- of the screen, most of them do.)
26 mpress("Button4", "WScreen.switch_prev(_)"),
27 mpress("Button5", "WScreen.switch_next(_)"),
28 mpress(MOD1.."Button4", "WScreen.switch_prev(_)"),
29 mpress(MOD1.."Button5", "WScreen.switch_next(_)"),
31 -- When a WClientWin is set to fullscreen mode, the mouse
32 -- can do little about it unless there happen to be gaps
33 -- where the "screen" area shines through. Since this is
34 -- often the case esp. with fullscreen terminal emulators, I've
35 -- included button2 to exit fullscreen mode, and button3
36 -- brings up the main menu by default in cfg_bindings.
37 mpress("Button2", "WClientWin.set_fullscreen(_sub, 'toggle')"),
40 defbindings("WFrame", {
42 bdoc("Bring up a context menu from anywhere in the frame."),
43 mpress(MOD1.."Shift+Button3", "mod_menu.pmenu(_, _sub, 'ctxmenu')"),
45 bdoc("Toggle tagged."),
46 mpress(MOD1.."Button2", "_sub:set_tagged('toggle')"),
47 bdoc("Attach tagged regions."),
48 mpress(MOD1.."Shift+Button2", "_:attach_tagged()"),
50 -- For mouse users I highly recommend button2 as a mainmenu,
51 -- otherwise it would be difficult to start programs using the mouse.
52 -- In Ion it's relevant which frame has focus when you start
53 -- something, so a file manager would work poorly for that purpose
54 -- unless it happened to be in the right frame.
55 mpress("Button1@client", "mod_menu.pmenu(_, _sub, 'mainmenu')"),
56 mpress("Button2@border", "mod_menu.pmenu(_, _sub, 'mainmenu')"),
58 bdoc("Maximize vertical on double click"),
59 mdblclick("Button1", "WFrame.maximize_vert(_)"),
61 -- Use the wheel over the tab bar to scroll through windows in a frame.
62 -- Oddly enough, it still works if you've hidden the tab bar.
63 -- Just use the wheel over the top edge of the screen.
64 -- Or use Mod4 and the wheel to avoid having to aim at anything.
65 mpress("Button5@tab", "WScreen.switch_next(_)"),
66 mpress("Button4@tab", "WScreen.switch_prev(_)"),
69 mpress("Button5", "_:parent():switch_next()"),
70 mpress("Button4", "_:parent():switch_prev()"),
72 mpress(MOD1.."Button4", "_:parent():switch_prev()"),
73 mpress(MOD1.."Button5", "_:parent():switch_next()"),
75 bdoc("Drag without aiming for a tab, using Mod1+Shift"),
76 mdrag(MOD1.."Shift+Button1", "WFrame.p_tabdrag(_)"),
78 --[[ These should already have happened in cfg_bindings.lua.
79 -- Uncomment if necessary.
81 bdoc("Switch the frame to display the object indicated by the tab."),
82 mclick("Button1@tab", "WFrame.p_switch_tab(_)"),
83 mclick("Button2@tab", "WFrame.p_switch_tab(_)"),
85 bdoc("Resize the frame."),
86 mdrag("Button1@border", "WFrame.p_resize(_)"),
87 mdrag(MOD1.."Button3", "WFrame.p_resize(_)"),
89 bdoc("Move the frame."),
90 mdrag(MOD1.."Button1", "WFrame.p_move(_)"),
92 bdoc("Move objects between frames by dragging and dropping the tab."),
93 mdrag("Button1@tab", "WFrame.p_tabdrag(_)"),
95 mpress("Button3", "mod_menu.pmenu(_, _sub, 'ctxmenu')"),
96 --]]
98 -- Using alsa-utils, by any chance? Have some volume control.
99 --[[
100 mpress(MOD1.."Control+Button4", "ioncore.exec_on(_, 'amixer set PCM 1+')"),
101 mpress(MOD1.."Control+Button5", "ioncore.exec_on(_, 'amixer set PCM 1-')"),
102 --]]
105 if MOD4 then
106 defbindings("WFrame", {
107 -- There were only a few bindings involving MOD4, so
108 -- I've fixed this to work with or without.
109 -- On my system it's the windows key, defined in
110 -- ~/.ion3/cfg_ion.lua as MOD4="Mod4+"
111 bdoc("Show/hide tab"),
112 mpress(MOD4.."Button1", "WFrame.set_tabbar(_, 'toggle')"),
114 bdoc("Quickly rename a frame."),
115 mpress(MOD4.."Shift+Button3", "mod_query.query_renameframe(_)"),
117 mpress(MOD4.."Button5", "WScreen.switch_next(_)"),
118 mpress(MOD4.."Button4", "WScreen.switch_prev(_)"),
120 else
121 defbindings("WFrame", {
122 bdoc("Show/hide tab"),
123 mclick(MOD1.."Shift+Button1", "WFrame.set_tabbar(_, 'toggle')"),
125 bdoc("Quickly rename a frame."),
126 mpress(MOD1.."Shift+Control+Button3", "mod_query.query_renameframe(_)"),
128 mpress(MOD1.."Shift+Button5", "WScreen.switch_next(_)"),
129 mpress(MOD1.."Shift+Button4", "WScreen.switch_prev(_)"),
131 end
133 if mod_ionws then
134 defbindings("WFrame-on-WIonWS", {
135 mpress("Button2@tab", "mod_menu.pmenu(_, _sub, 'mainmenu')"),
139 if mod_sp then
140 defbindings("WScratchpad", {
141 -- button1 to move the scratchpad
142 -- button2 to drag a tab out of the scratchpad onto another frame
143 -- button2 (full click) to hide the scratchpad
144 -- button3 is still a frame context menu
146 -- What's missing? mainmenu via mouse, as described above.
148 -- Why is that not important? Because you can button2 on any tab
149 -- or border in the background to bring up the main menu, and any
150 -- applications you start will land in the scratchpad. They can't
151 -- go anywhere else.
152 mdrag("Button1@tab", "_:p_move()"),
153 mdrag("Button2@tab", "_:p_tabdrag()"),
154 mclick("Button2", "mod_sp.set_shown_on(_:screen_of(), 'toggle')"),
158 if mod_query then
159 defbindings("WInput", {
160 bdoc("No sense reaching for the keyboard just to bat away a WMessage"),
161 mpress("Button3", "WInput.cancel(_)"),
165 if mod_menu then
166 defbindings("WMenu", {
167 bdoc("...or to close a menu."),
168 mpress("Button3", "WMenu.cancel(_)"),
174 -- Some additional items should go in the defctxmenu for WFrame
175 -- (or some other menu called by pmenu) in order to effectively
176 -- avoid the keyboard. Paste into cfg_menus.lua if desired.
178 --[[
179 menuentry("Toggle Tab", "WFrame.set_tabbar(_, 'toggle')"),
180 menuentry("Fullscreen", "WClientWin.set_fullscreen(_sub, 'toggle')",
181 "_sub:WClientWin"),
182 menuentry("Show Dock", "mod_dock.set_floating_shown_on(_:screen_of(), 'toggle')"),
183 menuentry("Show SP", "mod_sp.set_shown_on(_:screen_of(), 'toggle')"),
184 --]]
187 -- This is a gratuitous alternative way of displaying the scratchpad
188 -- with a mouse click. The dockapp wmnet takes an argument for a command
189 -- to be executed on a button1 click. The command reaches into the running
190 -- Ion3 and toggles the scratchpad.
192 -- Depends on mod_ionflux and (obviously) wmnet. Also presumes 1st screen.
193 --[[
195 wmnet --withdrawn --execute "ionflux -e \"mod_sp.set_shown_on(ioncore.region_list('WScreen')[1], 'toggle')\"" &
197 --]]