diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2017-07-09 18:37:37 +0100 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2017-07-09 18:37:37 +0100 |
commit | aefae07bde1937197dabea9233c484efd8228252 (patch) | |
tree | 1574e1fe7fc72dcea6703dc64f975ae2339ba473 /.config/awesome/stock/signals.lua | |
download | awesome-aefae07bde1937197dabea9233c484efd8228252.tar.gz |
Initial commit of my awesome configuration
Diffstat (limited to '.config/awesome/stock/signals.lua')
-rw-r--r-- | .config/awesome/stock/signals.lua | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/.config/awesome/stock/signals.lua b/.config/awesome/stock/signals.lua new file mode 100644 index 0000000..2c6b1ef --- /dev/null +++ b/.config/awesome/stock/signals.lua @@ -0,0 +1,73 @@ +awful = require("awful") +beautiful = require("beautiful") + +-- {{{ Signals +-- Signal function to execute when a new client appears. +client.connect_signal("manage", function (c) + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- if not awesome.startup then awful.client.setslave(c) end + + if awesome.startup and + not c.size_hints.user_position + and not c.size_hints.program_position then + -- Prevent clients from being unreachable after screen count changes. + awful.placement.no_offscreen(c) + end +end) + +-- Add a titlebar if titlebars_enabled is set to true in the rules. +client.connect_signal("request::titlebars", function(c) + -- buttons for the titlebar + local buttons = awful.util.table.join( + awful.button({ }, 1, function() + client.focus = c + c:raise() + awful.mouse.client.move(c) + end), + awful.button({ }, 3, function() + client.focus = c + c:raise() + awful.mouse.client.resize(c) + end) + ) + + awful.titlebar(c) : setup { + { -- Left + awful.titlebar.widget.iconwidget(c), + buttons = buttons, + layout = wibox.layout.fixed.horizontal + }, + { -- Middle + { -- Title + align = "center", + widget = awful.titlebar.widget.titlewidget(c) + }, + buttons = buttons, + layout = wibox.layout.flex.horizontal + }, + { -- Right + awful.titlebar.widget.floatingbutton (c), + awful.titlebar.widget.maximizedbutton(c), + awful.titlebar.widget.stickybutton (c), + awful.titlebar.widget.ontopbutton (c), + awful.titlebar.widget.closebutton (c), + layout = wibox.layout.fixed.horizontal() + }, + layout = wibox.layout.align.horizontal + } +end) + +-- Enable sloppy focus, so that focus follows mouse. +client.connect_signal("mouse::enter", function(c) + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end +end) + +client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) +client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) +-- }}} + + |