summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-01-22 11:51:19 +0100
committerErich Eckner <git@eckner.net>2020-01-22 11:51:19 +0100
commit3b822a14caf20ff2fc6d0a9c926718ff990a1c08 (patch)
treee7152a6dbc504d5069a17c75ea41c989443d841b
downloadansi-color-to-conky-color-3b822a14caf20ff2fc6d0a9c926718ff990a1c08.tar.xz
Initial commit
-rw-r--r--colors17
-rwxr-xr-xshell-color-to-conky-color37
2 files changed, 54 insertions, 0 deletions
diff --git a/colors b/colors
new file mode 100644
index 0000000..e6fd9fa
--- /dev/null
+++ b/colors
@@ -0,0 +1,17 @@
+1 #FFFFFF
+30 #000000
+31 #AA0000
+32 #00AA00
+33 #AA5500
+34 #0000AA
+35 #AA00AA
+36 #00AAAA
+37 #AAAAAA
+90 #555555
+91 #FF5555
+92 #55FF55
+93 #FFFF55
+94 #5555FF
+95 #FF55FF
+96 #55FFFF
+97 #FFFFFF
diff --git a/shell-color-to-conky-color b/shell-color-to-conky-color
new file mode 100755
index 0000000..ce1bafb
--- /dev/null
+++ b/shell-color-to-conky-color
@@ -0,0 +1,37 @@
+#!/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"
+ )"
+
+exit
+
+RTEXT = '\x1b[7m' # reverse
+NTEXT = '\x1b[0m' # normal
+BTEXT = '\x1b[1m' # bold
+RESET = '\33[0m'
+
+
+ 'black': NamedColor(index=0, light=False),
+ 'dark red': NamedColor(index=1, light=False),
+ 'dark green': NamedColor(index=2, light=False),
+ 'brown': NamedColor(index=3, light=False),
+ 'dark blue': NamedColor(index=4, light=False),
+ 'dark magenta': NamedColor(index=5, light=False),
+ 'dark cyan': NamedColor(index=6, light=False),
+ 'white': NamedColor(index=7, light=False),
+ 'dark gray': NamedColor(index=0, light=True), # actually light black
+ 'light red': NamedColor(index=1, light=True),
+ 'light green': NamedColor(index=2, light=True),
+ 'yellow': NamedColor(index=3, light=True),
+ 'light blue': NamedColor(index=4, light=True),
+ 'light magenta': NamedColor(index=5, light=True),
+ 'light cyan': NamedColor(index=6, light=True)
+ 'light gray': NamedColor(index=7, light=True),