summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2009-11-09 00:34:28 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2009-11-09 00:34:28 +0100
commit014464ecbf0702217895dda6c8105b1cb5102c2a (patch)
treeddce5a351042249b6718a0fe695d8b6d0e9a4ac3
parentf4e09a066c869aa2c69a71de23a2f5ec80fbfdb0 (diff)
downloadawesome-configs-014464ecbf0702217895dda6c8105b1cb5102c2a.tar.xz
rc.lua: revert "make use of the arrange signal"
This reverts commit f4e09a066c869aa2c69a71de23a2f5ec80fbfdb0. Code is now in git, as reference to anyone interested in the functionality explained in the previous commit message.
-rw-r--r--rc.lua49
1 files changed, 17 insertions, 32 deletions
diff --git a/rc.lua b/rc.lua
index 48fa6b5..94c1917 100644
--- a/rc.lua
+++ b/rc.lua
@@ -443,13 +443,17 @@ clientkeys = awful.util.table.join(
awful.key({ modkey }, "Up", function () awful.client.moveresize(0, -20, 0, 0) end),
awful.key({ modkey }, "Left", function () awful.client.moveresize(-20, 0, 0, 0) end),
awful.key({ modkey }, "Right", function () awful.client.moveresize(20, 0, 0, 0) end),
- awful.key({ modkey, "Shift" }, "f", function (c) awful.client.floating.toggle(c) end),
awful.key({ modkey, "Shift" }, "m", function (c) c:swap(awful.client.getmaster()) end),
awful.key({ modkey, "Shift" }, "c", function (c) exec("kill -CONT " .. c.pid) end),
awful.key({ modkey, "Shift" }, "s", function (c) exec("kill -STOP " .. c.pid) end),
awful.key({ modkey, "Shift" }, "t", function (c)
if c.titlebar then awful.titlebar.remove(c)
else awful.titlebar.add(c, { modkey = modkey }) end
+ end),
+ awful.key({ modkey, "Shift" }, "f", function (c) awful.client.floating.toggle(c)
+ if awful.client.floating.get(c)
+ then c.above = true; awful.titlebar.add(c); awful.placement.no_offscreen(c)
+ else c.above = false; awful.titlebar.remove(c) end
end)
)
-- }}}
@@ -534,8 +538,18 @@ awful.rules.rules = {
-- {{{ Signals
--
--- {{{ Manage signal handler
+-- {{{ Signal function to execute when a new client appears
client.add_signal("manage", function (c, startup)
+ -- Add a titlebar to each floating client
+ if awful.client.floating.get(c)
+ or awful.layout.get(c.screen) == awful.layout.suit.floating then
+ if not c.titlebar and c.class ~= "Xmessage" then
+ awful.titlebar.add(c, { modkey = modkey })
+ end
+ -- Floating clients are always on top
+ c.above = true
+ end
+
-- Enable sloppy focus
c:add_signal("mouse::enter", function (c)
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
@@ -563,37 +577,8 @@ client.add_signal("manage", function (c, startup)
end)
-- }}}
--- {{{ Focus signal handlers
+-- {{{ Focus signal functions
client.add_signal("focus", function (c) c.border_color = beautiful.border_focus end)
client.add_signal("unfocus", function (c) c.border_color = beautiful.border_normal end)
-- }}}
-
--- {{{ Arrange signal handler
-for s = 1, screen.count() do screen[s]:add_signal("arrange", function ()
- local clients = awful.client.visible(s)
- local layout = awful.layout.getname(awful.layout.get(s))
-
- if #clients > 0 then -- Fine grained borders and floaters control
- for _, c in pairs(clients) do -- Floaters always have borders
- if awful.client.floating.get(c) or layout == "floating" then
- c.border_width = beautiful.border_width
-
- if not c.fullscreen then -- Floaters have titlebars
- if not c.titlebar and c.class ~= "Xmessage" then
- awful.titlebar.add(c, { modkey = modkey })
- end -- Floaters are always on top
- c.above = true
- end
-
- -- No borders with only one visible client
- elseif #clients == 1 or layout == "max" then
- clients[1].border_width = 0
- else
- c.border_width = beautiful.border_width
- end
- end
- end
- end)
-end
--- }}}
-- }}}