]> git.rmz.io Git - dotfiles.git/commitdiff
add run_once function
authorSamir Benmendil <samir.benmendil@gmail.com>
Mon, 10 Jun 2013 16:14:05 +0000 (18:14 +0200)
committerSamir Benmendil <samir.benmendil@gmail.com>
Mon, 10 Jun 2013 16:14:05 +0000 (18:14 +0200)
awesome/autostart.lua [new file with mode: 0644]
awesome/rc.lua

diff --git a/awesome/autostart.lua b/awesome/autostart.lua
new file mode 100644 (file)
index 0000000..8adfc70
--- /dev/null
@@ -0,0 +1,24 @@
+-- http://awesome.naquadah.org/wiki/Autostart#Simple_way
+function run_once(prg,arg_string,pname,screen)
+    if not prg then
+        do return nil end
+    end
+
+    if not pname then
+       pname = prg
+    end
+
+    if not arg_string then 
+        awful.util.spawn_with_shell("pgrep -f -u $USER -x '" .. pname .. "' || (" .. prg .. ")",screen)
+    else
+        awful.util.spawn_with_shell("pgrep -f -u $USER -x '" .. pname .. " ".. arg_string .."' || (" .. prg .. " " .. arg_string .. ")",screen)
+    end
+end
+
+--run_once("xscreensaver","-no-splash")
+--run_once("pidgin",nil,nil,2)
+--run_once("wicd-client",nil,"/usr/bin/python2 -O /usr/share/wicd/gtk/wicd-client.py")
+run_once("xmodmap", "~/.Xmodmap")
+run_once("qupzilla")
+run_once("quassel")
+run_once("kopete")
index 9673c4f8e962071e209cfaa874b08fa32eac20f4..3b21402b474416bf154a270f7106e37dbd3476e3 100644 (file)
@@ -418,3 +418,7 @@ end)
 client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
 client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
 -- }}}
+
+-- {{{ Autostart applications
+require("autostart")
+-- }}}