Advertisement
Guest User

Run once with awesome session

a guest
Oct 19th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. -- Autostart with Awesome session
  2. function run_once(prg,arg_string,pname,screen)
  3.     if not prg then
  4.         do return nil end
  5.     end
  6.  
  7.     if not pname then
  8.        pname = prg
  9.     end
  10.  
  11.     if not arg_string then
  12.         awful.util.spawn_with_shell("pgrep -f -u $USER -x '" .. pname .. "' || (" .. prg .. ")",screen)
  13.     else
  14.         awful.util.spawn_with_shell("pgrep -f -u $USER -x '" .. pname .. " ".. arg_string .."' || (" .. prg .. " " .. arg_string .. ")",screen)
  15.     end
  16. end
  17.  
  18. run_once("urxvtd","--quiet --opendisplay --fork")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement