From c1e6f7f09b37e4ece220822887ad80cd6055dfbd Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 16 Dec 2016 22:01:26 +0100 Subject: add a battery widget --- config/awesome/rc.lua | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'config/awesome/rc.lua') diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua index b26cdeb..d10ada6 100644 --- a/config/awesome/rc.lua +++ b/config/awesome/rc.lua @@ -14,6 +14,7 @@ local menubar = require("menubar") -- Load Debian menu entries require("debian.menu") require("volume") +require("battery") require("weasel-rules") -- require("revelation") @@ -71,10 +72,10 @@ local layouts = -- awful.layout.suit.fair.horizontal, -- awful.layout.suit.spiral, -- awful.layout.suit.spiral.dwindle, - awful.layout.suit.max, + -- awful.layout.suit.max, -- awful.layout.suit.max.fullscreen, -- awful.layout.suit.magnifier - awful.layout.suit.floating, + -- awful.layout.suit.floating, } -- }}} @@ -206,6 +207,8 @@ for s = 1, screen.count() do local right_layout = wibox.layout.fixed.horizontal() if s == 1 then right_layout:add(wibox.widget.systray()) end right_layout:add(volume_widget) + right_layout:add(bat0_widget) + right_layout:add(bat1_widget) right_layout:add(mytextclock) right_layout:add(mylayoutbox[s]) @@ -270,8 +273,20 @@ globalkeys = awful.util.table.join( awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), - awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), - awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), + awful.key({ modkey, }, "space", function () + if awful.util.table.hasitem(layouts, awful.layout.get() ) then + awful.layout.inc(layouts, 1) + else + awful.layout.set(layouts[1]) + end + end), + awful.key({ modkey, "Shift" }, "space", function () + if awful.util.table.hasitem(layouts, awful.layout.get() ) then + awful.layout.inc(layouts, -1) + else + awful.layout.set(layouts[1]) + end + end), -- awful.key({ modkey, "Control" }, "n", awful.client.restore), @@ -390,7 +405,7 @@ clientkeys = awful.util.table.join( awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), awful.key({ modkey, }, "Return", function (c) c:swap(awful.client.getmaster()) end), awful.key({ modkey, }, "o", awful.client.movetoscreen ), - -- awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), + awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), -- weasel awful.key({ "Mod1" }, "q", function (c) @@ -561,11 +576,11 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n -- }}} terminal = "urxvt" -awful.util.spawn("nm-applet") -awful.util.spawn("klipper") +awful.util.spawn_with_shell("pkill -x -f nm-applet; nm-applet") +--awful.util.spawn_with_shell("pkill -x -f klipper; klipper") -- awful.util.spawn("xscreensaver -no-splash") --KDE--awful.util.spawn("X-screensaver") ---KDE--awful.util.spawn_with_shell("pkill -x -f clipit; clipit") +awful.util.spawn_with_shell("pkill -x -f clipit; clipit") awful.util.spawn_with_shell("pkill -x -f 'alsa-volume-monitor hw:0'; alsa-volume-monitor hw:0") -- vim:set softtabstop=4:ts=4:shiftwidth=4:et=1: -- cgit v1.2.3