From 1e1ac4c6404393f4fc08ec63cfccb49c625b1eb7 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 21 Sep 2013 08:50:45 +0200 Subject: 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 :) --- .config/awesome/awesome.lua | 17 ++++++++++++----- 1 file 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" -- cgit