summaryrefslogtreecommitdiff
path: root/.config/awesome
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-10-10 21:14:30 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-10-10 21:15:30 +0200
commit87bbcfa410bb60d9e3418f70b3cf129190148768 (patch)
treef13fb20c4825f19a585c24d85fc0c2b499d72cc8 /.config/awesome
parentd18d0c0071491e7a528db62f9021c9889db39c7c (diff)
downloaddotfiles-87bbcfa410bb60d9e3418f70b3cf129190148768.tar.gz
dotfiles-87bbcfa410bb60d9e3418f70b3cf129190148768.tar.bz2
dotfiles-87bbcfa410bb60d9e3418f70b3cf129190148768.zip
awesome: Use UPower's dbus interface for suspend
Also introduces cmds stores in cmds.lua
Diffstat (limited to '.config/awesome')
-rw-r--r--.config/awesome/awesome.lua6
-rw-r--r--.config/awesome/cmds.lua12
2 files changed, 16 insertions, 2 deletions
diff --git a/.config/awesome/awesome.lua b/.config/awesome/awesome.lua
index 391aab3..3593d23 100644
--- a/.config/awesome/awesome.lua
+++ b/.config/awesome/awesome.lua
@@ -17,6 +17,8 @@ beautiful.init(os.getenv("HOME") .. "/.local/share/awesome/themes/zenburn/theme.
local runonce = require("runonce")
+local cmd = require("cmds")
+
runonce.run("urxvtd -q -o -f")
runonce.run("start-pulseaudio-x11")
runonce.run("synergys")
@@ -227,8 +229,8 @@ globalkeys = awful.util.table.join(
awful.key({ }, "Print", function () awful.util.spawn("scrot") end),
awful.key({ modkey, }, "Print", function () awful.util.spawn("scrot -s") end),
- awful.key({ }, "XF86Suspend", function () awful.util.spawn("sudo pm-suspend") end),
- awful.key({ }, "XF86Sleep", function () awful.util.spawn("sudo pm-suspend") end),
+ awful.key({ }, "XF86Suspend", function () awful.util.spawn(cmd.suspend) end),
+ awful.key({ }, "XF86Sleep", function () awful.util.spawn(cmd.suspend) end),
awful.key({ }, "XF86MonBrightnessUp", function () awful.util.spawn("sudo brightness up") end),
awful.key({ }, "XF86MonBrightnessDown", function () awful.util.spawn("sudo brightness down") end),
awful.key({}, "XF86TouchpadToggle", function () awful.util.spawn(os.getenv("HOME") .. "/.scripts/toggle_touchpad.sh") end),
diff --git a/.config/awesome/cmds.lua b/.config/awesome/cmds.lua
new file mode 100644
index 0000000..713f807
--- /dev/null
+++ b/.config/awesome/cmds.lua
@@ -0,0 +1,12 @@
+module("eminent")
+
+local upower = "dbus-send --system --print-reply " ..
+ "--dest=org.freedesktop.UPower " ..
+ "/org/freedesktop/UPower "
+
+local cmds = {
+ suspend = upower .. "org.freedesktop.UPower.Suspend",
+ hibernate = upower .. "org.freedesktop.UPower.Hibernate",
+}
+
+return cmds