]> git.rmz.io Git - dotfiles.git/blob - awesome/bindings.lua
fix kmix spawning when steam games are running
[dotfiles.git] / awesome / bindings.lua
1 -- {{{ Mouse bindings
2 root.buttons(awful.util.table.join(
3 awful.button({ }, 3, function () mymainmenu:toggle() end),
4 awful.button({ }, 4, awful.tag.viewnext),
5 awful.button({ }, 5, awful.tag.viewprev)
6 ))
7
8 clientbuttons = awful.util.table.join(
9 awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
10 awful.button({ modkey }, 1, awful.mouse.client.move),
11 awful.button({ modkey }, 3, awful.mouse.client.resize))
12 -- }}}
13
14 -- {{{ Global Keys
15 globalkeys = awful.util.table.join(
16 -- {{{ Awesome Keys
17 awful.key({ modkey, }, "Left", awful.tag.viewprev ),
18 awful.key({ modkey, }, "Right", awful.tag.viewnext ),
19 awful.key({ modkey, }, "Escape", awful.tag.history.restore),
20
21 awful.key({ modkey, }, "j",
22 function ()
23 awful.client.focus.byidx( 1)
24 if client.focus then client.focus:raise() end
25 end),
26 awful.key({ modkey, }, "k",
27 function ()
28 awful.client.focus.byidx(-1)
29 if client.focus then client.focus:raise() end
30 end),
31 awful.key({ modkey }, "w", function () mymainmenu:show() end),
32
33 -- Layout manipulation
34 awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
35 awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
36 awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
37 awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
38 awful.key({ modkey, "Control" }, "Left", function () awful.screen.focus_relative( 1) end),
39 awful.key({ modkey, "Control" }, "Right", function () awful.screen.focus_relative(-1) end),
40 awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
41 awful.key({ modkey, }, "Tab",
42 function ()
43 awful.client.focus.history.previous()
44 if client.focus then
45 client.focus:raise()
46 end
47 end),
48
49 -- Standard program
50 awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
51 awful.key({ modkey, "Control" }, "r", awesome.restart),
52 awful.key({ modkey, "Shift" }, "q", awesome.quit),
53
54 awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
55 awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
56 awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
57 awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
58 awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
59 awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
60 awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
61 awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),
62
63 awful.key({ modkey, "Control" }, "n", awful.client.restore),
64
65 -- Prompt
66 awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
67
68 awful.key({ modkey }, "x",
69 function ()
70 awful.prompt.run({ prompt = "Run Lua code: " },
71 mypromptbox[mouse.screen].widget,
72 awful.util.eval, nil,
73 awful.util.getdir("cache") .. "/history_eval")
74 end),
75 -- Menubar
76 awful.key({ modkey }, "p", function() menubar.show() end),
77 -- }}}
78
79 -- {{{ My Keys
80 awful.key({ }, "F19", function () myshutdownmenu:show() end),
81 awful.key({ modkey }, "F1", function () myshutdownmenu:show() end),
82 -- Volume
83 awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("ponymix increase 5") end),
84 awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("ponymix decrease 5") end),
85 awful.key({ }, "XF86AudioMute", function () awful.util.spawn("ponymix toggle") end),
86 -- Clementine
87 awful.key({ }, "XF86AudioPlay", function () awful.util.spawn("clementine -t") end),
88 awful.key({ }, "XF86AudioNext", function () awful.util.spawn("clementine -f") end),
89 awful.key({ }, "XF86AudioPrev", function () awful.util.spawn("clementine -r") end),
90 awful.key({ "Shift" }, "XF86AudioRaiseVolume", function () awful.util.spawn("clementine --volume-increase-by 5") end),
91 awful.key({ "Shift" }, "XF86AudioLowerVolume", function () awful.util.spawn("clementine --volume-decrease-by 5") end)
92 -- }}}
93 )
94
95 -- {{{ Client keys
96 clientkeys = awful.util.table.join(
97 -- {{{ Awesome Client Keys
98 awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
99 awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
100 awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
101 awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
102 awful.key({ modkey, }, "o", awful.client.movetoscreen ),
103 awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
104 awful.key({ modkey, }, "n",
105 function (c)
106 -- The client currently has the input focus, so it cannot be
107 -- minimized, since minimized clients can't have the focus.
108 c.minimized = true
109 end),
110 awful.key({ modkey, }, "m",
111 function (c)
112 c.maximized_horizontal = not c.maximized_horizontal
113 c.maximized_vertical = not c.maximized_vertical
114 end)
115 -- }}}
116 )
117 -- }}}
118
119 -- Bind all key numbers to tags.
120 -- Be careful: we use keycodes to make it works on any keyboard layout.
121 -- This should map on the top row of your keyboard, usually 1 to 9.
122 for i = 1, 9 do
123 globalkeys = awful.util.table.join(globalkeys,
124 awful.key({ modkey }, "#" .. i + 9,
125 function ()
126 local screen = mouse.screen
127 local tag = awful.tag.gettags(screen)[i]
128 if tag then
129 awful.tag.viewonly(tag)
130 end
131 end),
132 awful.key({ modkey, "Control" }, "#" .. i + 9,
133 function ()
134 local screen = mouse.screen
135 local tag = awful.tag.gettags(screen)[i]
136 if tag then
137 awful.tag.viewtoggle(tag)
138 end
139 end),
140 awful.key({ modkey, "Shift" }, "#" .. i + 9,
141 function ()
142 local tag = awful.tag.gettags(client.focus.screen)[i]
143 if client.focus and tag then
144 awful.client.movetotag(tag)
145 end
146 end),
147 awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
148 function ()
149 local tag = awful.tag.gettags(client.focus.screen)[i]
150 if client.focus and tag then
151 awful.client.toggletag(tag)
152 end
153 end))
154 end
155
156 -- Set keys
157 root.keys(globalkeys)
158 -- }}}