diff options
| author | Dana Jansens <danakj@orodu.net> | 2008-02-09 18:26:15 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2008-02-09 19:02:08 -0500 |
| commit | b2e52c7b48ee64213b4d9e3fbab0d35f66410122 (patch) | |
| tree | 3567ee7bf848a0b352a71289c06f7fd62e36fee0 /tools | |
| parent | 11408575b38c71600193f51c08514d0412b6f586 (diff) | |
make xdg-autostart check for PyXDG and print a better error than a backtrace. and make the executing actually work
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/xdg-autostart/xdg-autostart | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/xdg-autostart/xdg-autostart b/tools/xdg-autostart/xdg-autostart index 6cee1342..daa9117d 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(): |
