quizzmaster

Untitled

May 13th, 2016
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. -- start applications only once
  2. function run_once(prg, args)
  3.     if not prg then
  4.         do return nil end
  5.     end
  6.     if not args then
  7.         args = ""
  8.     end
  9.  
  10.     awful.util.spawn_with_shell('pgrep '..prg..' || ('..prg..' '..args..')')
  11. end
  12.  
  13. -- start application only once (with path to detect original app started by a script with the same name)
  14. function run_once_p(path, prg, args)
  15.     if not prg or not path then
  16.         do return nil end
  17.     end
  18.     if not args then
  19.         args = ""
  20.     end
  21.  
  22.     awful.util.spawn_with_shell('pgrep '..prg..' || ('..path..prg..' '..args..')')
  23. end
  24.  
  25. -- start applications via starter which differs from applicationname when running
  26. function run_once_spec(prg, prgs, args)
  27.   if not prg or not prgs then
  28.     do return nil end
  29.   end
  30.   if not args then
  31.     args=""
  32.   end
  33.  
  34.   awful.util.spawn_with_shell('pgrep '..prgs..' || ('..prg..' '..args..')')
  35. end
Advertisement
Add Comment
Please, Sign In to add comment