summaryrefslogtreecommitdiff
path: root/.config/awesome
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-09-21 08:50:45 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-09-21 08:53:49 +0200
commit1e1ac4c6404393f4fc08ec63cfccb49c625b1eb7 (patch)
tree19419607ba90bbf1eadab645365e9f2b82d8f538 /.config/awesome
parent22168020cf997aec2b238b4c2cc4a6f12249982f (diff)
downloaddotfiles-1e1ac4c6404393f4fc08ec63cfccb49c625b1eb7.tar.gz
dotfiles-1e1ac4c6404393f4fc08ec63cfccb49c625b1eb7.tar.bz2
dotfiles-1e1ac4c6404393f4fc08ec63cfccb49c625b1eb7.zip
awesome: Replace runonce lua script by systemd-run
systemd-run can be used similar by creating a transient scope unit. Scope units are not forked of by systemd-run and the environment is kept (which we need for $DISPLAY..). Also, by giving an explicit name of the unit, we ensure, it will not be start twice, since the unit already exists. This works just perfectly! and is much faster when booting and launching big stuff like nm-applet and lxpolkit :)
Diffstat (limited to '.config/awesome')
-rw-r--r--.config/awesome/awesome.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/.config/awesome/awesome.lua b/.config/awesome/awesome.lua
index 7441f02..01f3d6d 100644
--- a/.config/awesome/awesome.lua
+++ b/.config/awesome/awesome.lua
@@ -17,13 +17,20 @@ require("vicious")
-- Themes define colours, icons, and wallpapers
beautiful.init(os.getenv("HOME") .. "/.local/share/awesome/themes/zenburn/theme.lua")
-local runonce = require("runonce")
-
local cmd = require("cmds")
-runonce.run(cmd.urxvtd)
-runonce.run("start-pulseaudio-x11")
-runonce.run(cmd.swIcon)
+function spawn_once(unit, cmd)
+ awful.util.spawn("systemd-run --user --scope --unit " .. unit .. " -- " .. cmd, false)
+end
+
+--local runonce = require("runonce")
+--local spawn_once = function(unit, cmd) runonce.run(cmd) end
+
+spawn_once("urxvtd", cmd.urxvtd)
+spawn_once("pulseaudio", "start-pulseaudio-x11")
+spawn_once("switch-icon", cmd.swIcon)
+spawn_once("lxpolkit", "/usr/libexec/lxpolkit")
+spawn_once("nm-applet", "nm-applet")
-- This is used later as the default terminal and editor to run.
terminal = "urxvtc"