summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorLeif Middelschulte <leif.middelschulte@gmail.com>2013-01-21 19:18:01 +0000
committerLeif Middelschulte <leif.middelschulte@gmail.com>2013-01-21 19:18:01 +0000
commit658feafb901c77fb6882afd9348d55271d16e324 (patch)
tree7a7d2ae9e1ec17f846feec125997e9b335529439 /scripts
parentf6e80e14dc700b20ede4855b93060f0943ba98a6 (diff)
Add script to facilitate term color->edje color class conversion.
SVN revision: 83044
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/colorparser.zsh12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/colorparser.zsh b/scripts/colorparser.zsh
new file mode 100755
index 0000000..38e45c5
--- /dev/null
+++ b/scripts/colorparser.zsh
@@ -0,0 +1,12 @@
1#!/bin/zsh
2# Converts *color lines to edje color classes
3# grep \*color ~/.Xresources | ./colorparser.zsh
4while read line
5do
6 color_index=`echo $line | sed 's/\*color\([0-9][0-9]\?\):#[0-9a-Z]\+/\1/'`
7 color=`echo $line | sed 's/\*color\([0-9][0-9]\?\):#\([0-9a-Z]\+\)/\2/'`
8 color_r=$(echo "ibase=16;${color[1,2]:u}" | bc)
9 color_g=$(echo "ibase=16;${color[3,4]:u}" | bc)
10 color_b=$(echo "ibase=16;${color[5,6]:u}" | bc)
11 echo "color_class { name: \"256color-$color_index\"; color: $color_r $color_g $color_b 255; }"
12done