3 Awesome WM configuration template
8 -- {{{ Required libraries
9 local awesome, client, mouse, screen, tag = awesome, client, mouse, screen, tag
10 local ipairs, string, os, table, tostring, tonumber, type = ipairs, string, os, table, tostring, tonumber, type
12 local gears = require("gears")
13 local awful = require("awful")
14 require("awful.autofocus")
15 local wibox = require("wibox")
16 local beautiful = require("beautiful")
17 local naughty = require("naughty")
18 local lain = require("lain")
19 --local menubar = require("menubar")
20 local freedesktop = require("freedesktop")
21 local hotkeys_popup = require("awful.hotkeys_popup").widget
22 require("awful.hotkeys_popup.keys")
23 local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
24 local dpi = require("beautiful.xresources").apply_dpi
28 -- Check if awesome encountered an error during startup and fell back to
29 -- another config (This code will only ever execute for the fallback config)
30 if awesome.startup_errors then
31 naughty.notify({ preset = naughty.config.presets.critical,
32 title = "Oops, there were errors during startup!",
33 text = awesome.startup_errors })
36 -- Handle runtime errors after startup
38 local in_error = false
39 awesome.connect_signal("debug::error", function (err)
40 if in_error then return end
43 naughty.notify({ preset = naughty.config.presets.critical,
44 title = "Oops, an error happened!",
45 text = tostring(err) })
51 -- {{{ Autostart windowless processes
53 -- This function will run once every time Awesome is started
54 local function run_once(cmd_arr)
55 for _, cmd in ipairs(cmd_arr) do
56 awful.spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd))
60 run_once({ "urxvtd", "unclutter -root" }) -- entries must be separated by commas
62 -- This function implements the XDG autostart specification
64 awful.spawn.with_shell(
65 'if (xrdb -query | grep -q "^awesome\\.started:\\s*true$"); then exit; fi;' ..
66 'xrdb -merge <<< "awesome.started:true";' ..
67 -- list each of your autostart commands, followed by ; inside single quotes, followed by ..
68 'dex --environment Awesome --autostart --search-paths "$XDG_CONFIG_DIRS/autostart:$XDG_CONFIG_HOME/autostart"' -- https://github.com/jceb/dex
74 -- {{{ Variable definitions
83 "powerarrow-dark", -- 7
89 local chosen_theme = themes[5]
92 local terminal = "urxvtc"
93 local vi_focus = false -- vi-like client focus - https://github.com/lcpz/awesome-copycats/issues/275
94 local cycle_prev = true -- cycle trough all previous client or just the first -- https://github.com/lcpz/awesome-copycats/issues/274
95 local editor = os.getenv("EDITOR") or "vim"
96 local gui_editor = os.getenv("GUI_EDITOR") or "gvim"
97 local browser = os.getenv("BROWSER") or "firefox"
98 local scrlocker = "slock"
100 awful.util.terminal = terminal
101 awful.util.tagnames = { "1", "2", "3", "4", "5" }
102 awful.layout.layouts = {
103 awful.layout.suit.floating,
104 awful.layout.suit.tile,
105 awful.layout.suit.tile.left,
106 awful.layout.suit.tile.bottom,
107 awful.layout.suit.tile.top,
108 --awful.layout.suit.fair,
109 --awful.layout.suit.fair.horizontal,
110 --awful.layout.suit.spiral,
111 --awful.layout.suit.spiral.dwindle,
112 --awful.layout.suit.max,
113 --awful.layout.suit.max.fullscreen,
114 --awful.layout.suit.magnifier,
115 --awful.layout.suit.corner.nw,
116 --awful.layout.suit.corner.ne,
117 --awful.layout.suit.corner.sw,
118 --awful.layout.suit.corner.se,
119 --lain.layout.cascade,
120 --lain.layout.cascade.tile,
121 --lain.layout.centerwork,
122 --lain.layout.centerwork.horizontal,
123 --lain.layout.termfair,
124 --lain.layout.termfair.center,
127 awful.util.taglist_buttons = my_table.join(
128 awful.button({ }, 1, function(t) t:view_only() end),
129 awful.button({ modkey }, 1, function(t)
131 client.focus:move_to_tag(t)
134 awful.button({ }, 3, awful.tag.viewtoggle),
135 awful.button({ modkey }, 3, function(t)
137 client.focus:toggle_tag(t)
140 awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
141 awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
144 awful.util.tasklist_buttons = my_table.join(
145 awful.button({ }, 1, function (c)
146 if c == client.focus then
149 --c:emit_signal("request::activate", "tasklist", {raise = true})<Paste>
151 -- Without this, the following
152 -- :isvisible() makes no sense
154 if not c:isvisible() and c.first_tag then
155 c.first_tag:view_only()
157 -- This will also un-minimize
158 -- the client, if needed
163 awful.button({ }, 2, function (c) c:kill() end),
164 awful.button({ }, 3, function ()
168 if instance and instance.wibox.visible then
172 instance = awful.menu.clients({theme = {width = dpi(250)}})
176 awful.button({ }, 4, function () awful.client.focus.byidx(1) end),
177 awful.button({ }, 5, function () awful.client.focus.byidx(-1) end)
180 lain.layout.termfair.nmaster = 3
181 lain.layout.termfair.ncol = 1
182 lain.layout.termfair.center.nmaster = 3
183 lain.layout.termfair.center.ncol = 1
184 lain.layout.cascade.tile.offset_x = dpi(2)
185 lain.layout.cascade.tile.offset_y = dpi(32)
186 lain.layout.cascade.tile.extra_padding = dpi(5)
187 lain.layout.cascade.tile.nmaster = 5
188 lain.layout.cascade.tile.ncol = 2
190 beautiful.init(string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme))
194 local myawesomemenu = {
195 { "hotkeys", function() return false, hotkeys_popup.show_help end },
196 { "manual", terminal .. " -e man awesome" },
197 { "edit config", string.format("%s -e %s %s", terminal, editor, awesome.conffile) },
198 { "restart", awesome.restart },
199 { "quit", function() awesome.quit() end }
201 awful.util.mymainmenu = freedesktop.menu.build({
202 icon_size = beautiful.menu_height or dpi(16),
204 { "Awesome", myawesomemenu, beautiful.awesome_icon },
205 -- other triads can be put here
208 { "Open terminal", terminal },
209 -- other triads can be put here
212 -- hide menu when mouse leaves it
213 --awful.util.mymainmenu.wibox:connect_signal("mouse::leave", function() awful.util.mymainmenu:hide() end)
215 --menubar.utils.terminal = terminal -- Set the Menubar terminal for applications that require it
219 -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
220 screen.connect_signal("property::geometry", function(s)
222 if beautiful.wallpaper then
223 local wallpaper = beautiful.wallpaper
224 -- If wallpaper is a function, call it with the screen
225 if type(wallpaper) == "function" then
226 wallpaper = wallpaper(s)
228 gears.wallpaper.maximized(wallpaper, s, true)
232 -- No borders when rearranging only 1 non-floating or maximized client
233 screen.connect_signal("arrange", function (s)
234 local only_one = #s.tiled_clients == 1
235 for _, c in pairs(s.clients) do
236 if only_one and not c.floating or c.maximized then
239 c.border_width = beautiful.border_width
243 -- Create a wibox for each screen and add it
244 awful.screen.connect_for_each_screen(function(s) beautiful.at_screen_connect(s) end)
247 -- {{{ Mouse bindings
248 root.buttons(my_table.join(
249 awful.button({ }, 3, function () awful.util.mymainmenu:toggle() end),
250 awful.button({ }, 4, awful.tag.viewnext),
251 awful.button({ }, 5, awful.tag.viewprev)
256 globalkeys = my_table.join(
258 -- https://github.com/lcpz/dots/blob/master/bin/screenshot
259 awful.key({ altkey }, "p", function() os.execute("screenshot") end,
260 {description = "take a screenshot", group = "hotkeys"}),
263 awful.key({ altkey, "Control" }, "l", function () os.execute(scrlocker) end,
264 {description = "lock screen", group = "hotkeys"}),
267 awful.key({ modkey, }, "s", hotkeys_popup.show_help,
268 {description = "show help", group="awesome"}),
270 awful.key({ modkey, }, "Left", awful.tag.viewprev,
271 {description = "view previous", group = "tag"}),
272 awful.key({ modkey, }, "Right", awful.tag.viewnext,
273 {description = "view next", group = "tag"}),
274 awful.key({ modkey, }, "Escape", awful.tag.history.restore,
275 {description = "go back", group = "tag"}),
277 -- Non-empty tag browsing
278 awful.key({ altkey }, "Left", function () lain.util.tag_view_nonempty(-1) end,
279 {description = "view previous nonempty", group = "tag"}),
280 awful.key({ altkey }, "Right", function () lain.util.tag_view_nonempty(1) end,
281 {description = "view previous nonempty", group = "tag"}),
283 -- Default client focus
284 awful.key({ altkey, }, "j",
286 awful.client.focus.byidx( 1)
288 {description = "focus next by index", group = "client"}
290 awful.key({ altkey, }, "k",
292 awful.client.focus.byidx(-1)
294 {description = "focus previous by index", group = "client"}
297 -- By direction client focus
298 awful.key({ modkey }, "j",
300 awful.client.focus.global_bydirection("down")
301 if client.focus then client.focus:raise() end
303 {description = "focus down", group = "client"}),
304 awful.key({ modkey }, "k",
306 awful.client.focus.global_bydirection("up")
307 if client.focus then client.focus:raise() end
309 {description = "focus up", group = "client"}),
310 awful.key({ modkey }, "h",
312 awful.client.focus.global_bydirection("left")
313 if client.focus then client.focus:raise() end
315 {description = "focus left", group = "client"}),
316 awful.key({ modkey }, "l",
318 awful.client.focus.global_bydirection("right")
319 if client.focus then client.focus:raise() end
321 {description = "focus right", group = "client"}),
322 awful.key({ modkey, }, "w", function () awful.util.mymainmenu:show() end,
323 {description = "show main menu", group = "awesome"}),
325 -- Layout manipulation
326 awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
327 {description = "swap with next client by index", group = "client"}),
328 awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
329 {description = "swap with previous client by index", group = "client"}),
330 awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
331 {description = "focus the next screen", group = "screen"}),
332 awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
333 {description = "focus the previous screen", group = "screen"}),
334 awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
335 {description = "jump to urgent client", group = "client"}),
336 awful.key({ modkey, }, "Tab",
339 awful.client.focus.history.previous()
341 awful.client.focus.byidx(-1)
347 {description = "cycle with previous/go back", group = "client"}),
348 awful.key({ modkey, "Shift" }, "Tab",
351 awful.client.focus.byidx(1)
357 {description = "go forth", group = "client"}),
360 awful.key({ modkey }, "b", function ()
362 s.mywibox.visible = not s.mywibox.visible
363 if s.mybottomwibox then
364 s.mybottomwibox.visible = not s.mybottomwibox.visible
368 {description = "toggle wibox", group = "awesome"}),
370 -- On the fly useless gaps change
371 awful.key({ altkey, "Control" }, "+", function () lain.util.useless_gaps_resize(1) end,
372 {description = "increment useless gaps", group = "tag"}),
373 awful.key({ altkey, "Control" }, "-", function () lain.util.useless_gaps_resize(-1) end,
374 {description = "decrement useless gaps", group = "tag"}),
377 awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end,
378 {description = "add new tag", group = "tag"}),
379 awful.key({ modkey, "Shift" }, "r", function () lain.util.rename_tag() end,
380 {description = "rename tag", group = "tag"}),
381 awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(-1) end,
382 {description = "move tag to the left", group = "tag"}),
383 awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(1) end,
384 {description = "move tag to the right", group = "tag"}),
385 awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end,
386 {description = "delete tag", group = "tag"}),
389 awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
390 {description = "open a terminal", group = "launcher"}),
391 awful.key({ modkey, "Control" }, "r", awesome.restart,
392 {description = "reload awesome", group = "awesome"}),
393 awful.key({ modkey, "Shift" }, "q", awesome.quit,
394 {description = "quit awesome", group = "awesome"}),
396 awful.key({ altkey, "Shift" }, "l", function () awful.tag.incmwfact( 0.05) end,
397 {description = "increase master width factor", group = "layout"}),
398 awful.key({ altkey, "Shift" }, "h", function () awful.tag.incmwfact(-0.05) end,
399 {description = "decrease master width factor", group = "layout"}),
400 awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
401 {description = "increase the number of master clients", group = "layout"}),
402 awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
403 {description = "decrease the number of master clients", group = "layout"}),
404 awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
405 {description = "increase the number of columns", group = "layout"}),
406 awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
407 {description = "decrease the number of columns", group = "layout"}),
408 awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
409 {description = "select next", group = "layout"}),
410 awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
411 {description = "select previous", group = "layout"}),
413 awful.key({ modkey, "Control" }, "n",
415 local c = awful.client.restore()
416 -- Focus restored client
422 {description = "restore minimized", group = "client"}),
424 -- Dropdown application
425 awful.key({ modkey, }, "z", function () awful.screen.focused().quake:toggle() end,
426 {description = "dropdown application", group = "launcher"}),
429 awful.key({ altkey, }, "c", function () if beautiful.cal then beautiful.cal.show(7) end end,
430 {description = "show calendar", group = "widgets"}),
431 awful.key({ altkey, }, "h", function () if beautiful.fs then beautiful.fs.show(7) end end,
432 {description = "show filesystem", group = "widgets"}),
433 awful.key({ altkey, }, "w", function () if beautiful.weather then beautiful.weather.show(7) end end,
434 {description = "show weather", group = "widgets"}),
437 awful.key({ }, "XF86MonBrightnessUp", function () os.execute("xbacklight -inc 10") end,
438 {description = "+10%", group = "hotkeys"}),
439 awful.key({ }, "XF86MonBrightnessDown", function () os.execute("xbacklight -dec 10") end,
440 {description = "-10%", group = "hotkeys"}),
442 -- ALSA volume control
443 awful.key({ altkey }, "Up",
445 os.execute(string.format("amixer -q set %s 1%%+", beautiful.volume.channel))
446 beautiful.volume.update()
448 {description = "volume up", group = "hotkeys"}),
449 awful.key({ altkey }, "Down",
451 os.execute(string.format("amixer -q set %s 1%%-", beautiful.volume.channel))
452 beautiful.volume.update()
454 {description = "volume down", group = "hotkeys"}),
455 awful.key({ altkey }, "m",
457 os.execute(string.format("amixer -q set %s toggle", beautiful.volume.togglechannel or beautiful.volume.channel))
458 beautiful.volume.update()
460 {description = "toggle mute", group = "hotkeys"}),
461 awful.key({ altkey, "Control" }, "m",
463 os.execute(string.format("amixer -q set %s 100%%", beautiful.volume.channel))
464 beautiful.volume.update()
466 {description = "volume 100%", group = "hotkeys"}),
467 awful.key({ altkey, "Control" }, "0",
469 os.execute(string.format("amixer -q set %s 0%%", beautiful.volume.channel))
470 beautiful.volume.update()
472 {description = "volume 0%", group = "hotkeys"}),
475 awful.key({ altkey, "Control" }, "Up",
477 os.execute("mpc toggle")
478 beautiful.mpd.update()
480 {description = "mpc toggle", group = "widgets"}),
481 awful.key({ altkey, "Control" }, "Down",
483 os.execute("mpc stop")
484 beautiful.mpd.update()
486 {description = "mpc stop", group = "widgets"}),
487 awful.key({ altkey, "Control" }, "Left",
489 os.execute("mpc prev")
490 beautiful.mpd.update()
492 {description = "mpc prev", group = "widgets"}),
493 awful.key({ altkey, "Control" }, "Right",
495 os.execute("mpc next")
496 beautiful.mpd.update()
498 {description = "mpc next", group = "widgets"}),
499 awful.key({ altkey }, "0",
501 local common = { text = "MPD widget ", position = "top_middle", timeout = 2 }
502 if beautiful.mpd.timer.started then
503 beautiful.mpd.timer:stop()
504 common.text = common.text .. lain.util.markup.bold("OFF")
506 beautiful.mpd.timer:start()
507 common.text = common.text .. lain.util.markup.bold("ON")
509 naughty.notify(common)
511 {description = "mpc on/off", group = "widgets"}),
513 -- Copy primary to clipboard (terminals to gtk)
514 awful.key({ modkey }, "c", function () awful.spawn.with_shell("xsel | xsel -i -b") end,
515 {description = "copy terminal to gtk", group = "hotkeys"}),
516 -- Copy clipboard to primary (gtk to terminals)
517 awful.key({ modkey }, "v", function () awful.spawn.with_shell("xsel -b | xsel") end,
518 {description = "copy gtk to terminal", group = "hotkeys"}),
521 awful.key({ modkey }, "q", function () awful.spawn(browser) end,
522 {description = "run browser", group = "launcher"}),
523 awful.key({ modkey }, "a", function () awful.spawn(gui_editor) end,
524 {description = "run gui editor", group = "launcher"}),
528 awful.key({ modkey }, "p", function() menubar.show() end,
529 {description = "show the menubar", group = "launcher"})
532 awful.key({ modkey }, "x", function ()
533 os.execute(string.format("dmenu_run -i -fn 'Monospace' -nb '%s' -nf '%s' -sb '%s' -sf '%s'",
534 beautiful.bg_normal, beautiful.fg_normal, beautiful.bg_focus, beautiful.fg_focus))
536 {description = "show dmenu", group = "launcher"})
538 -- alternatively use rofi, a dmenu-like application with more features
539 -- check https://github.com/DaveDavenport/rofi for more details
541 awful.key({ modkey }, "x", function ()
542 os.execute(string.format("rofi -show %s -theme %s",
545 {description = "show rofi", group = "launcher"}),
548 awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
549 {description = "run prompt", group = "launcher"}),
551 awful.key({ modkey }, "x",
554 prompt = "Run Lua code: ",
555 textbox = awful.screen.focused().mypromptbox.widget,
556 exe_callback = awful.util.eval,
557 history_path = awful.util.get_cache_dir() .. "/history_eval"
560 {description = "lua execute prompt", group = "awesome"})
564 clientkeys = my_table.join(
565 awful.key({ altkey, "Shift" }, "m", lain.util.magnify_client,
566 {description = "magnify client", group = "client"}),
567 awful.key({ modkey, }, "f",
569 c.fullscreen = not c.fullscreen
572 {description = "toggle fullscreen", group = "client"}),
573 awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
574 {description = "close", group = "client"}),
575 awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
576 {description = "toggle floating", group = "client"}),
577 awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
578 {description = "move to master", group = "client"}),
579 awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
580 {description = "move to screen", group = "client"}),
581 awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
582 {description = "toggle keep on top", group = "client"}),
583 awful.key({ modkey, }, "n",
585 -- The client currently has the input focus, so it cannot be
586 -- minimized, since minimized clients can't have the focus.
589 {description = "minimize", group = "client"}),
590 awful.key({ modkey, }, "m",
592 c.maximized = not c.maximized
595 {description = "maximize", group = "client"})
598 -- Bind all key numbers to tags.
599 -- Be careful: we use keycodes to make it works on any keyboard layout.
600 -- This should map on the top row of your keyboard, usually 1 to 9.
602 -- Hack to only show tags 1 and 9 in the shortcut window (mod+s)
603 local descr_view, descr_toggle, descr_move, descr_toggle_focus
604 if i == 1 or i == 9 then
605 descr_view = {description = "view tag #", group = "tag"}
606 descr_toggle = {description = "toggle tag #", group = "tag"}
607 descr_move = {description = "move focused client to tag #", group = "tag"}
608 descr_toggle_focus = {description = "toggle focused client on tag #", group = "tag"}
610 globalkeys = my_table.join(globalkeys,
612 awful.key({ modkey }, "#" .. i + 9,
614 local screen = awful.screen.focused()
615 local tag = screen.tags[i]
621 -- Toggle tag display.
622 awful.key({ modkey, "Control" }, "#" .. i + 9,
624 local screen = awful.screen.focused()
625 local tag = screen.tags[i]
627 awful.tag.viewtoggle(tag)
631 -- Move client to tag.
632 awful.key({ modkey, "Shift" }, "#" .. i + 9,
635 local tag = client.focus.screen.tags[i]
637 client.focus:move_to_tag(tag)
642 -- Toggle tag on focused client.
643 awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
646 local tag = client.focus.screen.tags[i]
648 client.focus:toggle_tag(tag)
656 clientbuttons = gears.table.join(
657 awful.button({ }, 1, function (c)
658 c:emit_signal("request::activate", "mouse_click", {raise = true})
660 awful.button({ modkey }, 1, function (c)
661 c:emit_signal("request::activate", "mouse_click", {raise = true})
662 awful.mouse.client.move(c)
664 awful.button({ modkey }, 3, function (c)
665 c:emit_signal("request::activate", "mouse_click", {raise = true})
666 awful.mouse.client.resize(c)
671 root.keys(globalkeys)
675 -- Rules to apply to new clients (through the "manage" signal).
676 awful.rules.rules = {
677 -- All clients will match this rule.
679 properties = { border_width = beautiful.border_width,
680 border_color = beautiful.border_normal,
681 focus = awful.client.focus.filter,
684 buttons = clientbuttons,
685 screen = awful.screen.preferred,
686 placement = awful.placement.no_overlap+awful.placement.no_offscreen,
687 size_hints_honor = false
692 { rule_any = { type = { "dialog", "normal" } },
693 properties = { titlebars_enabled = true } },
695 -- Set Firefox to always map on the first tag on screen 1.
696 { rule = { class = "Firefox" },
697 properties = { screen = 1, tag = awful.util.tagnames[1] } },
699 { rule = { class = "Gimp", role = "gimp-image-window" },
700 properties = { maximized = true } },
705 -- Signal function to execute when a new client appears.
706 client.connect_signal("manage", function (c)
707 -- Set the windows at the slave,
708 -- i.e. put it at the end of others instead of setting it master.
709 -- if not awesome.startup then awful.client.setslave(c) end
711 if awesome.startup and
712 not c.size_hints.user_position
713 and not c.size_hints.program_position then
714 -- Prevent clients from being unreachable after screen count changes.
715 awful.placement.no_offscreen(c)
719 -- Add a titlebar if titlebars_enabled is set to true in the rules.
720 client.connect_signal("request::titlebars", function(c)
722 if beautiful.titlebar_fun then
723 beautiful.titlebar_fun(c)
728 -- buttons for the titlebar
729 local buttons = my_table.join(
730 awful.button({ }, 1, function()
731 c:emit_signal("request::activate", "titlebar", {raise = true})
732 awful.mouse.client.move(c)
734 awful.button({ }, 2, function() c:kill() end),
735 awful.button({ }, 3, function()
736 c:emit_signal("request::activate", "titlebar", {raise = true})
737 awful.mouse.client.resize(c)
741 awful.titlebar(c, {size = dpi(16)}) : setup {
743 awful.titlebar.widget.iconwidget(c),
745 layout = wibox.layout.fixed.horizontal
750 widget = awful.titlebar.widget.titlewidget(c)
753 layout = wibox.layout.flex.horizontal
756 awful.titlebar.widget.floatingbutton (c),
757 awful.titlebar.widget.maximizedbutton(c),
758 awful.titlebar.widget.stickybutton (c),
759 awful.titlebar.widget.ontopbutton (c),
760 awful.titlebar.widget.closebutton (c),
761 layout = wibox.layout.fixed.horizontal()
763 layout = wibox.layout.align.horizontal
767 -- Enable sloppy focus, so that focus follows mouse.
768 client.connect_signal("mouse::enter", function(c)
769 c:emit_signal("request::activate", "mouse_enter", {raise = vi_focus})
772 client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
773 client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
775 -- possible workaround for tag preservation when switching back to default screen:
776 -- https://github.com/lcpz/awesome-copycats/issues/251