From 5dcd172bae25192a5366e8ad1ad3a9d7ed7a8247 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Tue, 9 May 2017 11:35:01 +0100 Subject: Add various changes --- zsh/.zsh/functions | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'zsh/.zsh') diff --git a/zsh/.zsh/functions b/zsh/.zsh/functions index 5ea454f..ae85104 100644 --- a/zsh/.zsh/functions +++ b/zsh/.zsh/functions @@ -3,7 +3,7 @@ [[ -z ${ZSH_COLORS} ]] && ZSH_COLORS=${HOME}/.local/share/zsh/colors.zsh [[ -f ${ZSH_COLORS} ]] && source ${ZSH_COLORS} -colorschemes=$(echo ${HOME}/.Xresources/* | sed "s#${HOME}/.Xresources/##g") +colorschemes=$(ls ${HOME}/.Xresources) function colo { @@ -15,7 +15,9 @@ function colo { -e 's/.*background:/\x1b]11;/p' \ -e 's/.*foreground:/\x1b]10;/p' \ -e 's/.*borderColor:/\x1b]708;/p' \ - -e 's/.*color\([0-9][^:]*\):/\x1b]4;\1;/p' | tr \\n \\a + -e 's/.*color\([0-9][^:]*\):/\x1b]4;\1;/p' | tr \\n "\007" + + [ ! -z "$TMUX" ] && printf '\033Ptmux;\033\033]11;white\007\033' # Change color for future sessions xrdb ${XRESOURCE_FILE} @@ -23,11 +25,8 @@ function colo { # Change default environment variable for future sessions mkdir -p $(dirname ${ZSH_COLORS}) - COLORSCHEME=$(echo ${XRESOURCE} | sed 's/\([^.]\+\)\..\+$/\1/g') - BACKGROUND=$(echo ${XRESOURCE} | sed 's/^.\+\(dark\|light\)/\1/') - - echo "export COLORSCHEME=${COLORSCHEME}" > ${ZSH_COLORS} - echo "export BACKGROUND=${BACKGROUND}" >> ${ZSH_COLORS} + echo "export COLORSCHEME=${XRESOURCE%.*}" > ${ZSH_COLORS} + echo "export BACKGROUND=${XRESOURCE#*.}" >> ${ZSH_COLORS} echo "export XRESOURCE=${XRESOURCE}" >> ${ZSH_COLORS} source ${ZSH_COLORS} } -- cgit v1.2.3