#!/usr/bin/env python

import sys
import os
from subprocess import Popen

from importlib.machinery import SourceFileLoader

Popen(("xrdb","-merge",os.path.expanduser("~/.Xresources")))

conf = SourceFileLoader("conf", os.path.expanduser("~/.xinitrc.py")).load_module()
name, executable, depends = conf.environments[int(sys.argv[1])]

if depends:
    if hasattr(depends, '__iter__'):
        for i in depends:
            i.run()
    else:
        depends.run()
os.execlp(executable, executable)

@@ -67,16 +67,42 @@
  Popen%0A%0A
+from ianxenv import Task%0A%0A
 from imp
@@ -146,71 +146,8 @@
 der%0A
-%0APopen((%22xrdb%22,%22-merge%22,os.path.expanduser(%22~/.Xresources%22)))%0A%0A
 conf
@@ -294,55 +294,138 @@
 )%5D%0A%0A
-if depends:%0A    if hasattr(depends, '__iter__')
+Popen((%22xrdb%22, %22-merge%22, os.path.expanduser(%22~/.Xresources%22)))%0A%0Aif depends:%0A    if depends is Task:%0A        depends.run()%0A    else
 :%0A  
@@ -472,39 +472,8 @@
 n()%0A
-    else:%0A        depends.run()
 %0Aos.

improve ianxenvstart.py