summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2020-01-16 17:17:47 -0800
committerMike Crute <mike@crute.us>2020-01-16 17:19:33 -0800
commit0a780e27424765a14b4746e14868cf83030234df (patch)
tree364f528c120ff59c5646ff7a684fac6e77aeb174 /.config
parent54b5e8da1ef5b17d25468b9663d0da2485f1c25b (diff)
downloaddotfiles-0a780e27424765a14b4746e14868cf83030234df.tar.bz2
dotfiles-0a780e27424765a14b4746e14868cf83030234df.tar.xz
dotfiles-0a780e27424765a14b4746e14868cf83030234df.zip
Merge default config into rc.lua
Diffstat (limited to '.config')
-rw-r--r--.config/awesome/rc.lua68
1 files changed, 42 insertions, 26 deletions
diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua
index 7c763f3..d56ddd6 100644
--- a/.config/awesome/rc.lua
+++ b/.config/awesome/rc.lua
@@ -13,7 +13,7 @@ local beautiful = require("beautiful")
13-- Notification library 13-- Notification library
14local naughty = require("naughty") 14local naughty = require("naughty")
15local menubar = require("menubar") 15local menubar = require("menubar")
16local hotkeys_popup = require("awful.hotkeys_popup").widget 16local hotkeys_popup = require("awful.hotkeys_popup")
17-- Enable hotkeys help widget for VIM and other apps 17-- Enable hotkeys help widget for VIM and other apps
18-- when client with a matching name is opened: 18-- when client with a matching name is opened:
19require("awful.hotkeys_popup.keys") 19require("awful.hotkeys_popup.keys")
@@ -54,6 +54,8 @@ mcrute.customize_theme()
54 54
55-- This is used later as the default terminal and editor to run. 55-- This is used later as the default terminal and editor to run.
56terminal = os.getenv("HOME") .. "/bin/st" 56terminal = os.getenv("HOME") .. "/bin/st"
57editor = os.getenv("EDITOR") or "vi"
58editor_cmd = terminal .. " -e " .. editor
57 59
58-- Default modkey. 60-- Default modkey.
59-- Usually, Mod4 is the key with a logo between Control and Alt. 61-- Usually, Mod4 is the key with a logo between Control and Alt.
@@ -71,6 +73,9 @@ awful.layout.layouts = mcrute.get_layouts()
71menubar.utils.terminal = terminal -- Set the terminal for applications that require it 73menubar.utils.terminal = terminal -- Set the terminal for applications that require it
72-- }}} 74-- }}}
73 75
76-- Keyboard map indicator and switcher
77mykeyboardlayout = awful.widget.keyboardlayout()
78
74-- {{{ Wibar 79-- {{{ Wibar
75-- Create a textclock widget 80-- Create a textclock widget
76mytextclock = mcrute.get_clock() 81mytextclock = mcrute.get_clock()
@@ -98,16 +103,11 @@ local tasklist_buttons = gears.table.join(
98 if c == client.focus then 103 if c == client.focus then
99 c.minimized = true 104 c.minimized = true
100 else 105 else
101 -- Without this, the following 106 c:emit_signal(
102 -- :isvisible() makes no sense 107 "request::activate",
103 c.minimized = false 108 "tasklist",
104 if not c:isvisible() and c.first_tag then 109 {raise = true}
105 c.first_tag:view_only() 110 )
106 end
107 -- This will also un-minimize
108 -- the client, if needed
109 client.focus = c
110 c:raise()
111 end 111 end
112 end), 112 end),
113 awful.button({ }, 3, function (c) c:kill() end), 113 awful.button({ }, 3, function (c) c:kill() end),
@@ -151,10 +151,18 @@ awful.screen.connect_for_each_screen(function(s)
151 awful.button({ }, 4, function () awful.layout.inc( 1) end), 151 awful.button({ }, 4, function () awful.layout.inc( 1) end),
152 awful.button({ }, 5, function () awful.layout.inc(-1) end))) 152 awful.button({ }, 5, function () awful.layout.inc(-1) end)))
153 -- Create a taglist widget 153 -- Create a taglist widget
154 s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons) 154 s.mytaglist = awful.widget.taglist {
155 screen = s,
156 filter = awful.widget.taglist.filter.all,
157 buttons = taglist_buttons
158 }
155 159
156 -- Create a tasklist widget 160 -- Create a tasklist widget
157 s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons) 161 s.mytasklist = awful.widget.tasklist {
162 screen = s,
163 filter = awful.widget.tasklist.filter.currenttags,
164 buttons = tasklist_buttons
165 }
158 166
159 -- Create the wibox 167 -- Create the wibox
160 s.mywibox = awful.wibar({ position = "top", screen = s }) 168 s.mywibox = awful.wibar({ position = "top", screen = s })
@@ -253,8 +261,9 @@ globalkeys = gears.table.join(
253 local c = awful.client.restore() 261 local c = awful.client.restore()
254 -- Focus restored client 262 -- Focus restored client
255 if c then 263 if c then
256 client.focus = c 264 c:emit_signal(
257 c:raise() 265 "request::activate", "key.unminimize", {raise = true}
266 )
258 end 267 end
259 end, 268 end,
260 {description = "restore minimized", group = "client"}), 269 {description = "restore minimized", group = "client"}),
@@ -375,9 +384,18 @@ for i = 1, 9 do
375end 384end
376 385
377clientbuttons = gears.table.join( 386clientbuttons = gears.table.join(
378 awful.button({ }, 1, function (c) client.focus = c; c:raise() end), 387 awful.button({ }, 1, function (c)
379 awful.button({ modkey }, 1, awful.mouse.client.move), 388 c:emit_signal("request::activate", "mouse_click", {raise = true})
380 awful.button({ modkey }, 3, awful.mouse.client.resize)) 389 end),
390 awful.button({ modkey }, 1, function (c)
391 c:emit_signal("request::activate", "mouse_click", {raise = true})
392 awful.mouse.client.move(c)
393 end),
394 awful.button({ modkey }, 3, function (c)
395 c:emit_signal("request::activate", "mouse_click", {raise = true})
396 awful.mouse.client.resize(c)
397 end)
398)
381 399
382-- Set keys 400-- Set keys
383root.keys(globalkeys) 401root.keys(globalkeys)
@@ -413,10 +431,13 @@ awful.rules.rules = {
413 "Kruler", 431 "Kruler",
414 "MessageWin", -- kalarm. 432 "MessageWin", -- kalarm.
415 "Sxiv", 433 "Sxiv",
434 "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
416 "Wpa_gui", 435 "Wpa_gui",
417 "veromix", 436 "veromix",
418 "xtightvncviewer"}, 437 "xtightvncviewer"},
419 438
439 -- Note that the name property shown in xprop might be set slightly after creation of the client
440 -- and the name shown there might not match defined rules here.
420 name = { 441 name = {
421 "Event Tester", -- xev. 442 "Event Tester", -- xev.
422 }, 443 },
@@ -454,13 +475,11 @@ client.connect_signal("request::titlebars", function(c)
454 -- buttons for the titlebar 475 -- buttons for the titlebar
455 local buttons = gears.table.join( 476 local buttons = gears.table.join(
456 awful.button({ }, 1, function() 477 awful.button({ }, 1, function()
457 client.focus = c 478 c:emit_signal("request::activate", "titlebar", {raise = true})
458 c:raise()
459 awful.mouse.client.move(c) 479 awful.mouse.client.move(c)
460 end), 480 end),
461 awful.button({ }, 3, function() 481 awful.button({ }, 3, function()
462 client.focus = c 482 c:emit_signal("request::activate", "titlebar", {raise = true})
463 c:raise()
464 awful.mouse.client.resize(c) 483 awful.mouse.client.resize(c)
465 end) 484 end)
466 ) 485 )
@@ -493,10 +512,7 @@ end)
493 512
494-- Enable sloppy focus, so that focus follows mouse. 513-- Enable sloppy focus, so that focus follows mouse.
495client.connect_signal("mouse::enter", function(c) 514client.connect_signal("mouse::enter", function(c)
496 if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier 515 c:emit_signal("request::activate", "mouse_enter", {raise = false})
497 and awful.client.focus.filter(c) then
498 client.focus = c
499 end
500end) 516end)
501 517
502client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) 518client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)