-
Notifications
You must be signed in to change notification settings - Fork 6
/
input.yml
235 lines (205 loc) · 9.45 KB
/
input.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# Python modules to import action functions from. Action functions
# are functions taking (mode, event) parameters.
imports:
- glass_input.actions.focus
- glass_input.actions.title_search
- glass_input.actions.pan
- glass_input.actions.zoom
- glass_input.actions.zoom_to
- glass_input.actions.item_pan
- glass_input.actions.item_zoom
- glass_input.actions.item_pan
- glass_input.actions.item_resize
- glass_input.actions.item_zoom_to
- glass_input.actions.actions
- glass_input.actions.tile
- glass_input.actions.modeswitch
- glass_input.actions.islands
# Event filter macros whose names can be used insead of an actual
# event filter in a key in a keymap (see any mode below). Values have
# the same semantics as keymap keys.
eventfilters:
MainKey: Mod4Mask
ItemKey: Mod1Mask
ResizeKey: ControlMask
SmallerActionKey: ShiftMask
# Input modes represent different states glass-input can be in,
# and defines what actions are bound to which keys in that mode,
# as well as how to transition to other modes.
# Input modes have a keymapping defining a mapping from event
# filters to actions. An action can be:
# * The name of another mode to switch to.
# * The word "pop" that goes back to the previous mode.
# * The name of an action function imported above
# * A dictionary with one key, the name of an action function,
# with a value that is a dictionary of extra parameters to that
# action function.
# * A dictionary with the key shell, who's value is a shell command to execute.
# * A list of actions to preform in order.
modes:
# Input mode entered when glass-input starts. Generally
# reverted to once all keys are released by the user after an
# action.
base_mode:
class: glass_input.base.BaseMode
keymap:
# Comment out the next line to have
# WIN+ALT+CTRL+RightClick to focus, and navigate focus
# with the keyboard with WIN+ALT+CTRL+ArrowKey
"GenericEventCode": focus_follows_mouse
"ButtonPress,MainKey": grabbed_mode
"KeyPress,MainKey": grabbed_mode
"KeyPress,XK_Super_L": grabbed_mode
# Grabbed mode is entered once the main trigger key has been
# pressed, and quickly dispatches to one of the other modes as
# soon as enough other keys/buttons are pressed to know which
# one to use.
grabbed_mode:
class: glass_input.grabbed.GrabbedMode
keymap:
"KeyRelease": pop
"ButtonRelease": pop
# "ButtonPress,ItemKey,MainKey,3": focus_mode
# "KeyPress,ItemKey,MainKey,XK_Up": focus_mode
# "KeyPress,ItemKey,MainKey,XK_Down": focus_mode
# "KeyPress,ItemKey,MainKey,XK_Left": focus_mode
# "KeyPress,ItemKey,MainKey,XK_Right": focus_mode
"KeyPress,XK_R": reload
"KeyPress,XK_space": rofi_mode
"KeyPress,XK_Escape": toggle_overlay
"MainKey,KeyPress,XK_F1": send_debug
"MainKey,KeyPress,XK_F4": send_close
"MainKey,KeyPress,XK_F5": send_sleep
"KeyPress,XK_E": send_exit
"KeyPress,XK_D": send_debug
"KeyPress,XK_C": send_close
"KeyPress,XK_S": send_sleep
"KeyPress,XK_F": title_search_mode
"KeyPress,XK_T,SmallerActionKey": tile_visible
"KeyPress,XK_T,!SmallerActionKey": tile_visible_to_1_1
"KeyPress,XK_O,SmallerActionKey": {"tile_visible": {"packer": "glass_input.cloud_packer.CloudPacker"}}
"KeyPress,XK_O,!SmallerActionKey": {"tile_visible_to_1_1": {"packer": "glass_input.cloud_packer.CloudPacker"}}
"KeyPress,XK_I": send_island_create
"KeyPress,!ItemKey,XK_Home": zoom_home
"ButtonPress,!ItemKey,4": zoom_mode
"ButtonPress,!ItemKey,5": zoom_mode
"KeyPress,!ItemKey,XK_Next": zoom_mode
"KeyPress,!ItemKey,XK_Prior": zoom_mode
"ButtonPress,!ItemKey,2": pan_mode
"ButtonPress,!ItemKey,1": pan_mode
"KeyPress,!ItemKey,XK_Up": pan_mode
"KeyPress,!ItemKey,XK_Down": pan_mode
"KeyPress,!ItemKey,XK_Left": pan_mode
"KeyPress,!ItemKey,XK_Right": pan_mode
"KeyPress,ItemKey,!SmallerActionKey,XK_Home": zoom_1_1_1
"KeyPress,ItemKey,SmallerActionKey,XK_Home": item_zoom_1_1_to_window
"ButtonPress,ItemKey,4": item_zoom_mode
"ButtonPress,ItemKey,5": item_zoom_mode
"KeyPress,ItemKey,XK_Next": item_zoom_mode
"KeyPress,ItemKey,XK_Prior": item_zoom_mode
"ButtonPress,ItemKey,1,!ResizeKey": item_pan_mode
"KeyPress,ItemKey,XK_Up,!ResizeKey": item_pan_mode
"KeyPress,ItemKey,XK_Down,!ResizeKey": item_pan_mode
"KeyPress,ItemKey,XK_Left,!ResizeKey": item_pan_mode
"KeyPress,ItemKey,XK_Right,!ResizeKey": item_pan_mode
"ButtonPress,ItemKey,1,ResizeKey": item_resize_mode
"KeyPress,ItemKey,XK_Up,ResizeKey": item_resize_mode
"KeyPress,ItemKey,XK_Down,ResizeKey": item_resize_mode
"KeyPress,ItemKey,XK_Left,ResizeKey": item_resize_mode
"KeyPress,ItemKey,XK_Right,ResizeKey": item_resize_mode
title_search_mode:
class: glass_input.title_search.TitleSearchMode
keymap:
"KeyPress,XK_Escape": pop
"KeyPress,XK_Return": pop
"KeyPress,!XK_Escape,!XK_Return": write
focus_mode:
class: glass_input.mode.Mode
keymap:
"KeyRelease,!AutoRepeat": pop
"ButtonRelease": pop
"ButtonPress,ItemKey,MainKey": focus_follows_mouse
"KeyPress,XK_Left,ItemKey,MainKey": focus_to_window_to_the_left
"KeyPress,XK_Right,ItemKey,MainKey": focus_to_window_to_the_right
"KeyPress,XK_Up,ItemKey,MainKey": focus_to_window_above
"KeyPress,XK_Down,ItemKey,MainKey": focus_to_window_below
zoom_mode:
class: glass_input.mode.Mode
keymap:
"KeyRelease,!AutoRepeat": pop
"ButtonRelease": pop
"ButtonRelease,4,SmallerActionKey": ["zoom_in", "pop"]
"ButtonRelease,5,SmallerActionKey": ["zoom_out", "pop"]
"ButtonPress,4,SmallerActionKey": zoom_in
"ButtonPress,5,SmallerActionKey": zoom_out
"ButtonPress,4,!SmallerActionKey": zoom_to_fewer_windows
"ButtonPress,5,!SmallerActionKey": zoom_to_more_windows
"KeyPress,XK_Prior,!SmallerActionKey": zoom_to_fewer_windows
"KeyPress,XK_Next,!SmallerActionKey": zoom_to_more_windows
"KeyPress,XK_Prior,SmallerActionKey": zoom_in
"KeyPress,XK_Next,SmallerActionKey": zoom_out
pan_mode:
class: glass_input.mode.Mode
keymap:
"KeyRelease": pop
"ButtonRelease": pop
"KeyPress,XK_Left,SmallerActionKey,!AutoRepeat": {"pan":{"x": 1, "y": 0}}
"KeyPress,XK_Right,SmallerActionKey,!AutoRepeat": {"pan":{"x": -1, "y": 0}}
"KeyPress,XK_Up,SmallerActionKey,!AutoRepeat": {"pan":{"x": 0, "y": 1}}
"KeyPress,XK_Down,SmallerActionKey,!AutoRepeat": {"pan":{"x": 0, "y": -1}}
"KeyPress,XK_Left,SmallerActionKey,AutoRepeat": {"pan":{"x": 10, "y": 0}}
"KeyPress,XK_Right,SmallerActionKey,AutoRepeat": {"pan":{"x": -10, "y": 0}}
"KeyPress,XK_Up,SmallerActionKey,AutoRepeat": {"pan":{"x": 0, "y": 10}}
"KeyPress,XK_Down,SmallerActionKey,AutoRepeat": {"pan":{"x": 0, "y": -10}}
"KeyPress,XK_Left,!SmallerActionKey": zoom_to_window_to_the_left
"KeyPress,XK_Right,!SmallerActionKey": zoom_to_window_to_the_right
"KeyPress,XK_Up,!SmallerActionKey": zoom_to_window_above
"KeyPress,XK_Down,!SmallerActionKey": zoom_to_window_below
"ButtonPress": pan_mouse
"MotionNotify": pan_mouse
item_zoom_mode:
class: glass_input.mode.Mode
load: {"ifnowin": {}}
keymap:
"KeyRelease": pop
"ItemKey,ButtonRelease,SmallerActionKey,4": item_zoom_in
"ItemKey,KeyPress,SmallerActionKey,XK_Prior": item_zoom_in
"ItemKey,ButtonRelease,SmallerActionKey,5": item_zoom_out
"ItemKey,KeyPress,SmallerActionKey,XK_Next": item_zoom_out
"ItemKey,ButtonRelease,4": item_zoom_in_or_1_1
"ItemKey,KeyPress,XK_Prior": item_zoom_in_or_1_1
"ItemKey,ButtonRelease,5": item_zoom_out_or_1_1
"ItemKey,KeyPress,XK_Next": item_zoom_out_or_1_1
item_pan_mode:
class: glass_input.mode.Mode
load: {"ifnowin": {"mode": "pan_mode"}}
keymap:
"KeyRelease,XK_Alt_L": pop
"ButtonRelease": pop
"KeyPress,XK_Left,!AutoRepeat": {"item_pan":{"x": -1, "y": 0}}
"KeyPress,XK_Right,!AutoRepeat": {"item_pan":{"x": 1, "y": 0}}
"KeyPress,XK_Up,!AutoRepeat": {"item_pan":{"x": 0, "y": -1}}
"KeyPress,XK_Down,!AutoRepeat": {"item_pan":{"x": 0, "y": 1}}
"KeyPress,XK_Left,AutoRepeat": {"item_pan":{"x": -10, "y": 0}}
"KeyPress,XK_Right,AutoRepeat": {"item_pan":{"x": 10, "y": 0}}
"KeyPress,XK_Up,AutoRepeat": {"item_pan":{"x": 0, "y": -10}}
"KeyPress,XK_Down,AutoRepeat": {"item_pan":{"x": 0, "y": 10}}
"Button1Mask,MotionNotify": item_pan_mouse
item_resize_mode:
class: glass_input.mode.Mode
keymap:
"KeyRelease": pop
"ButtonRelease": pop
"KeyPress,XK_Left,!AutoRepeat": {"item_resize":{"x": -1, "y": 0}}
"KeyPress,XK_Right,!AutoRepeat": {"item_resize":{"x": 1, "y": 0}}
"KeyPress,XK_Up,!AutoRepeat": {"item_resize":{"x": 0, "y": -1}}
"KeyPress,XK_Down,!AutoRepeat": {"item_resize":{"x": 0, "y": 1}}
"KeyPress,XK_Left,AutoRepeat": {"item_resize":{"x": -10, "y": 0}}
"KeyPress,XK_Right,AutoRepeat": {"item_resize":{"x": 10, "y": 0}}
"KeyPress,XK_Up,AutoRepeat": {"item_resize":{"x": 0, "y": -10}}
"KeyPress,XK_Down,AutoRepeat": {"item_resize":{"x": 0, "y": 10}}
"Button1Mask,MotionNotify": item_resize_mouse
island_change_background:
shell: "glass-action island set-background --window=%(last_event_window)s &"
rofi_mode:
shell: "rofi -show drun -theme ~/.config/glass/rofi-theme.config -show-icons &"