]> git.rmz.io Git - dotfiles.git/blob - awesome/bindings.lua
make the taglist squares smaller
[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, }, "u", awful.client.urgent.jumpto),
39 awful.key({ modkey, }, "Tab",
40 function ()
41 awful.client.focus.history.previous()
42 if client.focus then
43 client.focus:raise()
44 end
45 end),
46
47 -- Standard program
48 awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
49 awful.key({ modkey, "Control" }, "r", awesome.restart),
50 awful.key({ modkey, "Shift" }, "q", awesome.quit),
51
52 awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
53 awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
54 awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
55 awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
56 awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
57 awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
58
59 awful.key({ modkey, "Control" }, "n", awful.client.restore),
60
61 awful.key({ modkey }, "x",
62 function ()
63 awful.prompt.run({ prompt = "Run Lua code: " },
64 mypromptbox[mouse.screen].widget,
65 awful.util.eval, nil,
66 awful.util.getdir("cache") .. "/history_eval")
67 end),
68 -- Menubar
69 awful.key({ modkey }, "p", function() menubar.show() end),
70 -- }}}
71
72 -- {{{ My Keys
73 -- Prompt
74 awful.key({ modkey }, "space", function () mypromptbox[mouse.screen]:run() end),
75 -- switch layout
76 awful.key({ modkey }, "]", function () awful.layout.inc(layouts, 1) end),
77 awful.key({ modkey }, "[", function () awful.layout.inc(layouts, -1) end),
78 -- Shutdown menu
79 awful.key({ }, "F19", function () myshutdownmenu:show() end),
80 awful.key({ modkey }, "F1", function () myshutdownmenu:show() end),
81 -- Ksnapshot
82 awful.key({ }, "F13", function () awful.util.spawn("ksnapshot") end),
83 -- Layout manipulation
84 awful.key({ modkey, }, "#94", function () awful.screen.focus_relative( 1) end), -- that's the key left of 1
85 awful.key({ modkey, "Control" }, "Left", function () awful.screen.focus_relative( 1) end),
86 awful.key({ modkey, "Control" }, "Right", function () awful.screen.focus_relative(-1) end),
87 -- Volume
88 awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("ponymix increase 5") end),
89 awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("ponymix decrease 5") end),
90 awful.key({ }, "XF86AudioMute", function () awful.util.spawn("ponymix toggle") end),
91 -- Clementine
92 awful.key({ }, "XF86AudioPlay", function () awful.util.spawn("clementine -t") end),
93 awful.key({ }, "XF86AudioNext", function () awful.util.spawn("clementine -f") end),
94 awful.key({ }, "XF86AudioPrev", function () awful.util.spawn("clementine -r") end),
95 awful.key({ "Shift" }, "XF86AudioRaiseVolume", function () awful.util.spawn("clementine --volume-increase-by 5") end),
96 awful.key({ "Shift" }, "XF86AudioLowerVolume", function () awful.util.spawn("clementine --volume-decrease-by 5") end)
97 -- }}}
98 )
99 -- }}}
100
101 -- {{{ Client keys
102 clientkeys = awful.util.table.join(
103 -- {{{ Awesome Client Keys
104 awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
105 awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
106 awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
107 awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
108 awful.key({ modkey, }, "n",
109 function (c)
110 -- The client currently has the input focus, so it cannot be
111 -- minimized, since minimized clients can't have the focus.
112 c.minimized = true
113 end),
114 awful.key({ modkey, }, "m",
115 function (c)
116 c.maximized_horizontal = not c.maximized_horizontal
117 c.maximized_vertical = not c.maximized_vertical
118 end),
119 -- }}}
120
121 -- {{{ My Client Keys
122 -- Move client to screen
123 awful.key({ modkey, "Shift" }, "#94", awful.client.movetoscreen ),
124 -- ontop and below
125 awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
126 awful.key({ modkey, }, "b", function (c) c.below = not c.below end)
127 -- }}}
128 )
129 -- }}}
130
131 -- Bind all key numbers to tags.
132 -- Be careful: we use keycodes to make it works on any keyboard layout.
133 -- This should map on the top row of your keyboard, usually 1 to 9.
134 for i = 1, 9 do
135 globalkeys = awful.util.table.join(globalkeys,
136 awful.key({ modkey }, "#" .. i + 9,
137 function ()
138 local screen = mouse.screen
139 local tag = awful.tag.gettags(screen)[i]
140 if tag then
141 awful.tag.viewonly(tag)
142 end
143 end),
144 awful.key({ modkey, "Control" }, "#" .. i + 9,
145 function ()
146 local screen = mouse.screen
147 local tag = awful.tag.gettags(screen)[i]
148 if tag then
149 awful.tag.viewtoggle(tag)
150 end
151 end),
152 awful.key({ modkey, "Shift" }, "#" .. i + 9,
153 function ()
154 local tag = awful.tag.gettags(client.focus.screen)[i]
155 if client.focus and tag then
156 awful.client.movetotag(tag)
157 end
158 end),
159 awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
160 function ()
161 local tag = awful.tag.gettags(client.focus.screen)[i]
162 if client.focus and tag then
163 awful.client.toggletag(tag)
164 end
165 end))
166 end
167
168 -- }}}