diff --git a/xrdb2st.py b/xrdb2st.py index abba869..4069a4e 100755 --- a/xrdb2st.py +++ b/xrdb2st.py @@ -15,6 +15,7 @@ def main(filename): f = open(filename) colors = {} c2 = {} + print("{") for i in f.readlines(): (crap,color,rgb)=i.split(' ') cbits = color.split('_') @@ -34,29 +35,32 @@ def main(filename): pass l = colors.keys() for i in l: - print('"'+colors[i]+'", // '+str(i)) + print(' "'+colors[i]+'", // '+str(i)) x = 256 +# the 255 line + print(" [255] = 0,") try: - print("static unsigned int defaultbg = " + str(c2[bg])) +';' + print("//static unsigned int defaultbg = " + str(c2[bg])) +';' except: - print('"'+bg+'", /* bg color */') - print("static unsigned int defaultbg = " + str(x)) +';' + print(' "'+bg+'", /* bg color */') + print("//static unsigned int defaultbg = " + str(x)) +';' x=x+1 try: - print("static unsigned int defaultfg = " + str(c2[fg])) +';' + print("//static unsigned int defaultfg = " + str(c2[fg])) +';' except: - print('"'+fg+'", /* fg color */') - print("static unsigned int defaultfg = " + str(x)) +';' + print(' "'+fg+'", /* fg color */') + print("//static unsigned int defaultfg = " + str(x)) +';' x=x+1 try: - print("static unsigned int defaultcs = " + str(c2[cs])) +';' + print("//static unsigned int defaultcs = " + str(c2[cs])) +';' except: - print('"'+cs+'" /* cs color */') - print("static unsigned int defaultcs = " + str(x)) +';' + print(' "'+cs+'" /* cs color */') + print("//static unsigned int defaultcs = " + str(x)) +';' + print("},") if __name__ == '__main__':