summaryrefslogtreecommitdiff
path: root/ansi-color-to-conky-color
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-01-22 11:52:54 +0100
committerErich Eckner <git@eckner.net>2020-01-22 11:52:54 +0100
commitf03d4ee64d861a97dc330889f080bdc69924c454 (patch)
tree92ff14d16af6dcf782aec3522cd771ea8711a560 /ansi-color-to-conky-color
parent3b822a14caf20ff2fc6d0a9c926718ff990a1c08 (diff)
downloadansi-color-to-conky-color-f03d4ee64d861a97dc330889f080bdc69924c454.tar.xz
shell -> ansi
Diffstat (limited to 'ansi-color-to-conky-color')
-rwxr-xr-xansi-color-to-conky-color12
1 files changed, 12 insertions, 0 deletions
diff --git a/ansi-color-to-conky-color b/ansi-color-to-conky-color
new file mode 100755
index 0000000..9b9b1be
--- /dev/null
+++ b/ansi-color-to-conky-color
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+ sed '
+ s@\x1b\[0m@ ${color}@g
+ '"$(
+ while read -r code color; do
+ printf 's@\\x1b\\[\\(0;\\)\\?%sm@ ${color %s}@g\n' \
+ "${code}" \
+ "${color}"
+ done \
+ <"${0%/*}/colors"
+ )"