changes to make the output paste nicely into the config.h
This commit is contained in:
parent
54e8055963
commit
d8beb4de12
1 changed files with 14 additions and 10 deletions
16
xrdb2st.py
16
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('_')
|
||||
|
|
@ -37,26 +38,29 @@ def main(filename):
|
|||
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("//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("//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("//static unsigned int defaultcs = " + str(x)) +';'
|
||||
|
||||
print("},")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue