diff options
author | Urbain Vaes <urbain@vaes.uk> | 2016-04-22 14:07:33 +0100 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2016-04-22 14:07:33 +0100 |
commit | 467198df456011ee758ab2acd11964922bc7a18a (patch) | |
tree | e0710cd1268952ba7df95e7f96963f74e326e005 | |
parent | 7a91050181d7966e0501f7dcb19dc62f0dcefc9d (diff) |
Delete recolor script
-rwxr-xr-x | bin/bin/recolor | 8 | ||||
-rwxr-xr-x | bin/bin/run | 2 | ||||
-rw-r--r-- | input/.inputrc (renamed from input/inputrc) | 0 | ||||
-rwxr-xr-x | xinit/.xinitrc | 2 | ||||
-rw-r--r-- | zsh/.zsh/functions | 22 |
5 files changed, 18 insertions, 16 deletions
diff --git a/bin/bin/recolor b/bin/bin/recolor deleted file mode 100755 index edd5fa5..0000000 --- a/bin/bin/recolor +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -tr -d ' \t' | sed -n ' -s/.*background:/\x1b]11;/p -s/.*foreground:/\x1b]10;/p -s/.*borderColor:/\x1b]708;/p -s/.*color\([0-9][^:]*\):/\x1b]4;\1;/p -' | tr \\n \\a diff --git a/bin/bin/run b/bin/bin/run index 8ca03eb..b5ff85d 100755 --- a/bin/bin/run +++ b/bin/bin/run @@ -2,4 +2,4 @@ SCRIPTS_DIR="$HOME/bin" && cd $SCRIPTS_DIR SCRIPTS=$(ls -A $SCRIPTS_DIR) TARGET=$(echo "${SCRIPTS//"$SCRIPTS_DIR/"/}" | dmenu -i -p "Run script:") -[[ -n $TARGET ]] && "$SCRIPTS_DIR/$TARGET" +[[ -n $TARGET ]] && "$TARGET" diff --git a/input/inputrc b/input/.inputrc index 1221bb9..1221bb9 100644 --- a/input/inputrc +++ b/input/.inputrc diff --git a/xinit/.xinitrc b/xinit/.xinitrc index 9118272..92a562b 100755 --- a/xinit/.xinitrc +++ b/xinit/.xinitrc @@ -7,7 +7,7 @@ xset r rate 400 50 $HOME/bin/keyboard # Load Xresources to light colorscheme -xrdb -I$HOME ~/.Xresources/dark +xrdb -I$HOME ~/.Xresources/Tomorrow-Night-Eighties # Background feh --bg-fill --randomize /usr/share/backgrounds diff --git a/zsh/.zsh/functions b/zsh/.zsh/functions index 661fe17..f916655 100644 --- a/zsh/.zsh/functions +++ b/zsh/.zsh/functions @@ -1,4 +1,10 @@ -#!/bin/zsh +if [[ -z ${ZSH_COLORS} ]]; then + ZSH_COLORS=${HOME}/.local/share/zsh/colors.zsh +fi + +if [[ -f ${ZSH_COLORS} ]]; then + source ${ZSH_COLORS} +fi function colo { @@ -8,7 +14,6 @@ function colo { if [[ "${XRESOURCE}" == *"-dark" ]]; then export COLORSCHEME=${XRESOURCE%-dark} export BACKGROUND="dark" - echo ${COLORSCHEME} elif [[ "${XRESOURCE}" == *"-light" ]]; then export COLORSCHEME=${XRESOURCE%-light} export BACKGROUND="light" @@ -18,14 +23,19 @@ function colo { fi # Change colors for current session - $HOME/bin/recolor < ~/.Xresources/${XRESOURCE} - + cat ~/.Xresources/${XRESOURCE} | tr -d ' \t' | sed -n \ + -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 + # Load Xresources file for future sessions xrdb -I$HOME ~/.Xresources/${XRESOURCE} # Change default environment variable for future sessions - sed -i --follow-symlinks "s/^export COLORSCHEME=.*$/export COLORSCHEME=${COLORSCHEME}/g" ~/.zsh/tmp - sed -i --follow-symlinks "s/^export BACKGROUND=.*$/export BACKGROUND=${BACKGROUND}/g" ~/.zsh/tmp + mkdir -p $(dirname ${ZSH_COLORS}) + echo "export COLORSCHEME=${COLORSCHEME}" > ${ZSH_COLORS} + echo "export BACKGROUND=${BACKGROUND}" >> ${ZSH_COLORS} } # Completion for colorschemes (-M -> Case insensitive) |