From b9ea238dd7e8a56b1d171cdc76e405bb2a8584dd Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Wed, 21 Feb 2018 12:18:32 +0000 Subject: Improve i3 status --- zsh/.zsh/.zshrc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'zsh') diff --git a/zsh/.zsh/.zshrc b/zsh/.zsh/.zshrc index 95e989e..07009b8 100644 --- a/zsh/.zsh/.zshrc +++ b/zsh/.zsh/.zshrc @@ -78,15 +78,14 @@ zle -N z # }}} ## Colors {{{ -[[ -z ${ZSH_COLORS} ]] && ZSH_COLORS=${HOME}/.local/share/zsh/colors.zsh -[[ -f ${ZSH_COLORS} ]] && source ${ZSH_COLORS} +[[ -f $HOME/.local/colors.zsh ]] && source $HOME/.local/colors.zsh colorschemes=$(ls ${HOME}/.Xresources) function colo { - XRESOURCE=$1 - XRESOURCE_FILE=${HOME}/.Xresources/${XRESOURCE} + COLORSCHEME=$1 + XRESOURCE_FILE=${HOME}/.Xresources/$COLORSCHEME # Change colors for current session if [[ ! -z "$TMUX" ]]; then @@ -105,11 +104,23 @@ function colo { # Change color for future sessions xrdb ${XRESOURCE_FILE} + + echo "export COLORSCHEME=$1" > $HOME/.local/colors.zsh + source $HOME/.local/colors.zsh } # Completion for colorschemes (-M -> Case insensitive) compctl -k "(${colorschemes})" -M 'm:{a-z}={A-Z}' colo +function show256 { + for i in {0..255} ; do + printf "\x1b[48;5;%sm%3d\e[0m " "$i" "$i" + if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then + printf "\n"; + fi + done +} + # }}} ## Aliases {{{ -- cgit v1.2.3