From a6a082fb61c83a521f543e5b179a9c8d6ad4d540 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Mon, 28 Jun 2021 12:48:03 +0200 Subject: [PATCH] Add kitty color converter script --- scripts/kittyColorConverter.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 scripts/kittyColorConverter.py diff --git a/scripts/kittyColorConverter.py b/scripts/kittyColorConverter.py new file mode 100755 index 0000000..4a0944a --- /dev/null +++ b/scripts/kittyColorConverter.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# Source: https://gist.github.com/xdrie/aabe3b7507683001baf7762df005890b + +# Usage example: +# ./kittyColorConverter.py < xres_colors.txt >> ~/.config/kitty/kitty.conf + +from sys import stdin, stdout +import re + +in_conf = stdin.read() + +text = in_conf +text = re.sub('!', '#', text) +text = re.sub('\*.', '', text) +text = re.sub(':', '', text) + +stdout.write(text)