From bf05b1b11f8960cd96723c677558660521d33fb6 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 30 Oct 2014 01:52:16 +0100 Subject: [PATCH] Add function to shrink window to minimum pfx width Useful for testing Firefox and Picturefix's minimum width. --- awesome/.config/awesome/rc.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua index b0f187f..a25629b 100644 --- a/awesome/.config/awesome/rc.lua +++ b/awesome/.config/awesome/rc.lua @@ -46,6 +46,13 @@ function new_mail(maildir) return count end +function shrink_to_picturefix_width() + local g = client.focus:geometry() + + awful.client.floating.set(client.focus, true) + client.focus:geometry({x = g.x, y = g.y, width = 1066, height = 1060}) +end + -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to -- another config (This code will only ever execute for the fallback config) @@ -346,6 +353,7 @@ globalkeys = awful.util.table.join( awful.key({ modkey, "Shift" }, ",", function () awful.client.movetoscreen(client.focus, -1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto), awful.key({ modkey, }, "Tab", hpraise), + awful.key({ modkey, }, "g", shrink_to_picturefix_width), -- Standard program awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),