summaryrefslogtreecommitdiff
path: root/zsh/.zsh/functions
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2018-01-10 17:31:15 +0100
committerUrbain Vaes <urbain@vaes.uk>2018-01-10 18:09:54 +0100
commit773025b77b770286652c8c2929d445b231855363 (patch)
treebad2b729654e0f216d5f52fab990c077a6c0e0be /zsh/.zsh/functions
parentb63d5389cfca88ac1da44ebcff3139f420dd72f3 (diff)
Sort references by time
Diffstat (limited to 'zsh/.zsh/functions')
-rw-r--r--zsh/.zsh/functions40
1 files changed, 0 insertions, 40 deletions
diff --git a/zsh/.zsh/functions b/zsh/.zsh/functions
deleted file mode 100644
index c5bbb09..0000000
--- a/zsh/.zsh/functions
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/zsh
-
-[[ -z ${ZSH_COLORS} ]] && ZSH_COLORS=${HOME}/.local/share/zsh/colors.zsh
-[[ -f ${ZSH_COLORS} ]] && source ${ZSH_COLORS}
-
-colorschemes=$(ls ${HOME}/.Xresources)
-
-function colo {
-
- XRESOURCE=$1
- XRESOURCE_FILE=${HOME}/.Xresources/${XRESOURCE}
-
- # Change colors for current session
- if [[ ! -z "$TMUX" ]]; then
- printf '\x1bPtmux;'
- esc='\x1b\x1b'
- else
- esc='\x1b'
- fi
-
- /usr/bin/cpp ${XRESOURCE_FILE} | tr -d ' \t' | sed -n \
- -e "s/.*background:/${esc}]11;/p" \
- -e "s/.*foreground:/${esc}]10;/p" \
- -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}
-
- # Change default environment variable for future sessions
- mkdir -p $(dirname ${ZSH_COLORS})
-
- echo "export COLORSCHEME=${XRESOURCE%.*}" > ${ZSH_COLORS}
- echo "export BACKGROUND=${XRESOURCE#*.}" >> ${ZSH_COLORS}
- echo "export XRESOURCE=${XRESOURCE}" >> ${ZSH_COLORS}
- source ${ZSH_COLORS}
-}
-
-# Completion for colorschemes (-M -> Case insensitive)
-compctl -k "(${colorschemes})" -M 'm:{a-z}={A-Z}' colo