1 local hotkeys_popup = require("awful.hotkeys_popup").widget
2 local utils = require("utils")
9 root.buttons(gears.table.join(
10 awful.button({ }, 3, function () mymainmenu:toggle() end)
14 globalkeys = gears.table.join(globalkeys,
15 awful.key({ modkey, }, "s", hotkeys_popup.show_help,
16 {description="show help", group="awesome"}),
17 awful.key({ modkey, }, "Left", awful.tag.viewprev,
18 {description = "view previous", group = "tag"}),
19 awful.key({ modkey, }, "Down", awful.tag.viewprev,
20 {description = "view previous", group = "tag"}),
21 awful.key({ modkey, }, "Right", awful.tag.viewnext,
22 {description = "view next", group = "tag"}),
23 awful.key({ modkey, }, "Up", awful.tag.viewnext,
24 {description = "view next", group = "tag"}),
25 awful.key({ modkey, }, "Escape", awful.tag.history.restore,
26 {description = "go back", group = "tag"}),
28 awful.key({ modkey, }, "k",
30 awful.client.focus.byidx( 1)
32 {description = "focus next by index", group = "client"}
34 awful.key({ modkey, }, "j",
36 awful.client.focus.byidx(-1)
38 {description = "focus previous by index", group = "client"}
40 awful.key({ modkey, }, "w", function () mymainmenu:show({ coords = { x = 0, y = 0}}) end,
41 {description = "show main menu", group = "awesome"}),
43 -- Layout manipulation
44 awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( 1) end,
45 {description = "swap with next client by index", group = "client"}),
46 awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( -1) end,
47 {description = "swap with previous client by index", group = "client"}),
48 awful.key({ modkey, }, "#49", function () awful.screen.focus_relative( 1) end, -- that's the key left of 1 (chronos)
49 {description = "focus the next screen", group = "screen"}),
50 awful.key({ modkey, }, "=", function () awful.screen.focus_relative( 1) end, -- that's the key left of 1 (kinesis)
51 {description = "focus the next screen", group = "screen"}),
52 awful.key({ modkey, "Control" }, "Right", function () awful.screen.focus_relative(-1) end,
53 {description = "focus the next screen", group = "screen"}),
54 awful.key({ modkey, "Control" }, "Left", function () awful.screen.focus_relative(-1) end,
55 {description = "focus the previous screen", group = "screen"}),
56 awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
57 {description = "jump to urgent client", group = "client"}),
58 awful.key({ modkey, }, "Tab",
60 awful.client.focus.history.previous()
65 {description = "go back", group = "client"}),
68 awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
69 {description = "open a terminal", group = "launcher"}),
70 awful.key({ modkey, "Control" }, "r", awesome.restart,
71 {description = "reload awesome", group = "awesome"}),
73 awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
74 {description = "increase master width factor", group = "layout"}),
75 awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
76 {description = "decrease master width factor", group = "layout"}),
77 awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
78 {description = "increase the number of master clients", group = "layout"}),
79 awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
80 {description = "decrease the number of master clients", group = "layout"}),
81 awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
82 {description = "increase the number of columns", group = "layout"}),
83 awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
84 {description = "decrease the number of columns", group = "layout"}),
86 awful.key({ modkey, "Control" }, "j", function () awful.client.incwfact( 0.05) end,
87 {description = "increase focused client window factor", group = "layout"}),
88 awful.key({ modkey, "Control" }, "k", function () awful.client.incwfact(-0.05) end,
89 {description = "decrease focused client window factor", group = "layout"}),
91 -- switch between layouts
92 awful.key({ modkey, }, "]", function () awful.layout.inc( 1) end,
93 {description = "select next", group = "layout"}),
94 awful.key({ modkey, }, "[", function () awful.layout.inc(-1) end,
95 {description = "select previous", group = "layout"}),
97 awful.key({ modkey, "Control" }, "n",
99 local c = awful.client.restore()
100 -- Focus restored client
106 {description = "restore minimized", group = "client"}),
109 awful.key({ modkey }, "space", function () awful.screen.focused().mypromptbox:run() end,
110 {description = "run prompt", group = "launcher"}),
112 awful.key({ modkey }, "x",
115 prompt = "Run Lua code: ",
116 textbox = awful.screen.focused().mypromptbox.widget,
117 exe_callback = awful.util.eval,
118 history_path = gears.filesystem.get_cache_dir() .. "/history_eval"
121 {description = "lua execute prompt", group = "awesome"}),
125 awful.key({ }, "F13", function () awful.spawn("ksnapshot") end),
126 awful.key({ }, "Print", function () awful.spawn("ksnapshot") end),
128 awful.key({ modkey }, "r", function () utils.spawn_terminal("ranger") end),
130 awful.key({ }, "XF86AudioMute", function () awful.spawn("pulsemixer --toggle-mute") end,
131 {description = "toggle mute", group = "volume"}),
132 awful.key({ }, "XF86AudioLowerVolume", function () awful.spawn("pulsemixer --change-volume -5") end,
133 {description = "decrease volume", group = "volume"}),
134 awful.key({ }, "XF86AudioRaiseVolume", function () awful.spawn("pulsemixer --change-volume +5") end,
135 {description = "increase volume", group = "volume"}),
136 awful.key({ modkey }, "F10", function () awful.spawn("pulsemixer --toggle-mute") end,
137 {description = "toggle mute", group = "volume"}),
138 awful.key({ modkey }, "F11", function () awful.spawn("pulsemixer --change-volume -5") end,
139 {description = "decrease volume", group = "volume"}),
140 awful.key({ modkey }, "F12", function () awful.spawn("pulsemixer --change-volume +5") end,
141 {description = "increase volume", group = "volume"}),
143 awful.key({ modkey, "Control" }, "Escape", function () awful.spawn("i3lock -c 000000") end),
145 awful.key({ modkey }, "i", function ()
146 utils.spawn_terminal("vim -c 'call vimwiki#base#goto_index(v:count1)'", { instance = "vimwiki"})
149 -- requires a little sleep before simulating shift+Insert, otherwise I
150 -- believe the focus is still on awful and not the current window
151 awful.key({ modkey }, "\\", function () awful.spawn('xdotool sleep 0.2 key --clearmodifiers shift+Insert') end,
152 {description = "paste primary selection", group = "awesome"})
156 clientkeys = gears.table.join(
157 awful.key({ modkey, }, "f",
159 c.fullscreen = not c.fullscreen
162 {description = "toggle fullscreen", group = "client"}),
163 awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
164 {description = "close", group = "client"}),
165 awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
166 {description = "toggle floating", group = "client"}),
167 awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
168 {description = "move to master", group = "client"}),
169 awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
170 {description = "toggle keep on top", group = "client"}),
171 awful.key({ modkey, }, "b", function (c) c.below = not c.below end,
172 {description = "toggle keep below", group = "client"}),
173 awful.key({ modkey, }, "n",
175 -- The client currently has the input focus, so it cannot be
176 -- minimized, since minimized clients can't have the focus.
179 {description = "minimize", group = "client"}),
180 awful.key({ modkey, }, "m",
182 c.maximized = not c.maximized
185 {description = "maximize", group = "client"}),
187 -- Move client to screen
188 awful.key({ modkey, "Shift" }, "#94", function (c) c:move_to_screen() end,
189 {description = "move to screen", group = "client"}),
190 awful.key({ modkey, "Shift" }, "#49", function (c) c:move_to_screen() end,
191 {description = "move to screen", group = "client"}),
192 awful.key({ modkey, "Shift" }, "=", function (c) c:move_to_screen() end,
193 {description = "move to screen", group = "client"})
197 -- Bind all key numbers to tags.
198 -- Be careful: we use keycodes to make it works on any keyboard layout.
199 -- This should map on the top row of your keyboard, usually 1 to 9.
201 globalkeys = gears.table.join(globalkeys,
203 awful.key({ modkey }, "#" .. i + 9,
205 local screen = awful.screen.focused()
206 local tag = screen.tags[i]
209 awful.tag.history.restore(screen)
215 {description = "view tag #"..i, group = "tag"}),
216 -- Toggle tag display.
217 awful.key({ modkey, "Control" }, "#" .. i + 9,
219 local screen = awful.screen.focused()
220 local tag = screen.tags[i]
222 awful.tag.viewtoggle(tag)
225 {description = "toggle tag #" .. i, group = "tag"}),
226 -- Move client to tag.
227 awful.key({ modkey, "Shift" }, "#" .. i + 9,
230 local tag = client.focus.screen.tags[i]
232 client.focus:move_to_tag(tag)
236 {description = "move focused client to tag #"..i, group = "tag"}),
237 -- Toggle tag on focused client.
238 awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
241 local tag = client.focus.screen.tags[i]
243 client.focus:toggle_tag(tag)
247 {description = "toggle focused client on tag #" .. i, group = "tag"})
251 -- Client Buttons {{{1
252 clientbuttons = gears.table.join(
253 awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
254 awful.button({ modkey }, 1, awful.mouse.client.move),
255 awful.button({ modkey }, 3, awful.mouse.client.resize))