diff options
author | Urbain Vaes <urbain@vaes.uk> | 2017-05-09 11:35:01 +0100 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2017-05-09 11:35:01 +0100 |
commit | 5dcd172bae25192a5366e8ad1ad3a9d7ed7a8247 (patch) | |
tree | 06a24326fe9122b3d017ed99ef4e70be4da01167 /zsh/.zsh | |
parent | 9600f2f2037429da7179b2399347b1857028de85 (diff) |
Add various changes
Diffstat (limited to 'zsh/.zsh')
-rw-r--r-- | zsh/.zsh/functions | 13 |
1 files changed, 6 insertions, 7 deletions
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} } |