Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Convert .Xresources colours to st config format
from sys import argv
with open(argv[1]) as f:
lines = f.readlines()
d = dict()
for line in lines:
if line[0] != '*' or 'color' not in line:
color_num = int(line.split(':')[0][len('*.color'):])
d[color_num] = line.split()[1]
print("/* 8 normal colors */")
for color in sorted(d.items()):
if color[0] == 8:
print("/* 8 bright colors */")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment