SommitRealWeird

Awesome, Gnome Power Manager and ACPI

I use awesome as my window manager, without a gnome session around it - as gnome-power-manager now depends on having a gnome-session running, I had a choice to make - I don't need or want to run a gnome-session, so I went on the hunt for a different battery monitor for my laptop. I've ended up using fdpowermon as it does just what I need and nothing more - then I edited the default acpi scripts to do what I had gnome-power-manager doing before hand, i.e. if I've unplugged the AC and I close the lid, the laptop does a s2both. Slightly more configuration, but it now does what I expect all the time (yay!).

I wanted some extra keybinding from the default config of awesome in Debian, so I also created a very small rc.lua file as follows:

dofile("/etc/xdg/awesome/rc.lua")

mylayouts = {
    layouts[2],
    layouts[10],
    layouts[2],
    layouts[2],
    layouts[2],
    layouts[2],
    layouts[1],
    layouts[1],
    layouts[1]
}

for s = 1, screen.count() do
    for t = 1, 9 do
        awful.tag.setproperty(tags[s][t], "layout", mylayouts[t])
    end
end

globalkeys = awful.util.table.join(globalkeys,
    awful.key({"Control", "Mod1" }, "l", function () awful.util.spawn("/home/brettp/bin/lock-screen.sh") end)
)

root.keys(globalkeys)

This basically overrides parts of the default config and makes it so that my "tags" are vsplit for tags 1 and 3-6, maximised for tag 2 (where my browser lives) and floating for 7-9 (where the IM client sits, and I do anything involving GIMP). It does mean that I'm at the whim of the default config mostly, but as that seems to be fairly sane most of the time, that's not a problem... it also means that I'm only maintaining a small change set rather than a full rc file, and so new "features" can come in without me having to touch anything (well, other than restarting awesome...).

I do need to either unmap the minimise key combo, or create an unminimise key combo that pops up a menu with the list of minimised windows in it at some point, though - because it's all too easy to press Meta4-n when you meant Meta4-m.

Posted: 2012-03-22 11:54 in Tech | permalink