summaryrefslogtreecommitdiff
path: root/zsh
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2017-09-14 18:16:09 +0100
committerUrbain Vaes <urbain@vaes.uk>2017-10-14 16:28:18 +0200
commitcce7a634641855132e10f3304875862058fc6b6d (patch)
treea3c98588389ca4ac15ec7960299faa39dd18bd20 /zsh
parentc541ec2dcd39d32bcf9f289632d16b792c81746e (diff)
Add termite colors
Diffstat (limited to 'zsh')
-rw-r--r--zsh/.zsh/functions14
1 files changed, 13 insertions, 1 deletions
diff --git a/zsh/.zsh/functions b/zsh/.zsh/functions
index 0735fa2..411f27a 100644
--- a/zsh/.zsh/functions
+++ b/zsh/.zsh/functions
@@ -24,10 +24,22 @@ function colo {
-e "s/.*borderColor:/${esc}]708;/p" \
-e "s/.*color\\([0-9][^:]*\\):/${esc}]4;\\1;/p" | tr \\n \\a
-
# Change color for future sessions
xrdb ${XRESOURCE_FILE}
+ # Update termite colorscheme
+ TERMITE_CONFIG=~/.config/termite/config
+ while read -r line || [[ -n "$line" ]]; do
+ case "$line" in
+ *background* ) sed -i "s/^background.*$/background = ${line##* }/" ${TERMITE_CONFIG} ;;
+ *foreground* ) sed -i "s/^foreground.*$/foreground = ${line##* }/" ${TERMITE_CONFIG} ;;
+ *cursorColor* ) sed -i "s/^cursor.*$/cursor = ${line##* }/" ${TERMITE_CONFIG} ;;
+ *color[0-9]* ) color=$(echo ${line/:*/} | sed 's/.*color\([0-9]\+\)/\1/');
+ sed -i "s/^color${color}\>.*$/color${color} = ${line##* }/" ${TERMITE_CONFIG} ;;
+ * ) ;;
+ esac
+ done < ${XRESOURCE_FILE}
+
# Change default environment variable for future sessions
mkdir -p $(dirname ${ZSH_COLORS})