X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=tools%2Fxdg-autostart%2Fxdg-autostart;h=58855500ae09515a755a40c20f931838baed68da;hb=64398a2b5f1497868734b245c1231371dbfb4eb7;hp=6cee134209e6d4190325670b8eb84567eabd39da;hpb=11408575b38c71600193f51c08514d0412b6f586;p=chaz%2Fopenbox diff --git a/tools/xdg-autostart/xdg-autostart b/tools/xdg-autostart/xdg-autostart index 6cee1342..58855500 100755 --- a/tools/xdg-autostart/xdg-autostart +++ b/tools/xdg-autostart/xdg-autostart @@ -22,10 +22,16 @@ ME="xdg-autostart" VERSION="1.0" -from xdg import BaseDirectory -from xdg.DesktopEntry import DesktopEntry -from xdg.Exceptions import ParsingError import os, glob, sys +try: + from xdg import BaseDirectory + from xdg.DesktopEntry import DesktopEntry + from xdg.Exceptions import ParsingError +except ImportError: + print + print "ERROR:", ME, "requires PyXDG to be installed" + print + sys.exit(1) def main(argv=sys.argv): if "--help" in argv[1:]: @@ -154,8 +160,8 @@ class AutostartFile(): if self.de.getPath(): os.chdir(self.de.getPath()) if self.shouldRun(envs): - print "Running autostart file: " + self.path - os.system(self.de.getExec()); + args = ["/bin/sh", "-c", "exec " + self.de.getExec()] + os.spawnv(os.P_NOWAIT, args[0], args); os.chdir(here) def show_help(): @@ -172,7 +178,7 @@ def show_help(): print " --version Show version and copyright information" print print "ENVIRONMENT specifies a list of environments for which to run autostart" - print "applications for. If none are specified, only applications which do not " + print "applications. If none are specified, only applications which do not " print "limit themselves to certain environments will be run." print print "ENVIRONMENT can be one or more of:"