diff --git a/config/colorschemes/linux-console b/config/colorschemes/linux-console new file mode 100644 index 0000000..3cfd7e9 --- /dev/null +++ b/config/colorschemes/linux-console @@ -0,0 +1,30 @@ +#!/bin/sh + +TARGET="$HOME/.config/wryn/tty-colorscheme" +[ ! -f $TARGET ] && TARGET="$DOTWRYN/config/kitty/theme.conf" +echo $TARGET + +GET_COLOR_FROM_KITTY_THEME() { + grep "$1" $TARGET | awk '{print $2}' | sed 's/ //g; s/#//g' | tr '[:lower:]' '[:upper:]' +} + +/bin/echo -e "\ +\e]P0$(GET_COLOR_FROM_KITTY_THEME '^background ') +\e]P1$(GET_COLOR_FROM_KITTY_THEME '^color1 ') +\e]P2$(GET_COLOR_FROM_KITTY_THEME '^color2 ') +\e]P3$(GET_COLOR_FROM_KITTY_THEME '^color3 ') +\e]P4$(GET_COLOR_FROM_KITTY_THEME '^color4 ') +\e]P5$(GET_COLOR_FROM_KITTY_THEME '^color5 ') +\e]P6$(GET_COLOR_FROM_KITTY_THEME '^color6 ') +\e]P7$(GET_COLOR_FROM_KITTY_THEME '^foreground ') +\e]P8$(GET_COLOR_FROM_KITTY_THEME '^color9 ') +\e]P9$(GET_COLOR_FROM_KITTY_THEME '^color10 ') +\e]PA$(GET_COLOR_FROM_KITTY_THEME '^color11 ') +\e]PB$(GET_COLOR_FROM_KITTY_THEME '^color12 ') +\e]PC$(GET_COLOR_FROM_KITTY_THEME '^color13 ') +\e]PD$(GET_COLOR_FROM_KITTY_THEME '^color14 ') +\e]PE$(GET_COLOR_FROM_KITTY_THEME '^color7 ') +\e]PF$(GET_COLOR_FROM_KITTY_THEME '^color15 ') +" + +[[ "$TERM" = "linux" ]] && clear diff --git a/config/colorschemes/linux_console/CurrentKitty b/config/colorschemes/linux_console/CurrentKitty deleted file mode 100644 index 08da3cc..0000000 --- a/config/colorschemes/linux_console/CurrentKitty +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -GET_COLOR_FROM_KITTY_THEME() { - grep "$1" $DOTWRYN/config/kitty/theme.conf | awk '{print $2}' | sed 's/ //g; s/#//g' | tr '[:lower:]' '[:upper:]' -} - -if [ "$TERM" = "linux" ]; then - /bin/echo -e "\ - \e]P0$(GET_COLOR_FROM_KITTY_THEME '^background ') - \e]P1$(GET_COLOR_FROM_KITTY_THEME '^color1 ') - \e]P2$(GET_COLOR_FROM_KITTY_THEME '^color2 ') - \e]P3$(GET_COLOR_FROM_KITTY_THEME '^color3 ') - \e]P4$(GET_COLOR_FROM_KITTY_THEME '^color4 ') - \e]P5$(GET_COLOR_FROM_KITTY_THEME '^color5 ') - \e]P6$(GET_COLOR_FROM_KITTY_THEME '^color6 ') - \e]P7$(GET_COLOR_FROM_KITTY_THEME '^foreground ') - \e]P8$(GET_COLOR_FROM_KITTY_THEME '^color9 ') - \e]P9$(GET_COLOR_FROM_KITTY_THEME '^color10 ') - \e]PA$(GET_COLOR_FROM_KITTY_THEME '^color11 ') - \e]PB$(GET_COLOR_FROM_KITTY_THEME '^color12 ') - \e]PC$(GET_COLOR_FROM_KITTY_THEME '^color13 ') - \e]PD$(GET_COLOR_FROM_KITTY_THEME '^color14 ') - \e]PE$(GET_COLOR_FROM_KITTY_THEME '^color7 ') - \e]PF$(GET_COLOR_FROM_KITTY_THEME '^color15 ') - " - clear; -fi - diff --git a/config/colorschemes/linux_console/WrynChristmas b/config/colorschemes/linux_console/WrynChristmas deleted file mode 100644 index 29b19f2..0000000 --- a/config/colorschemes/linux_console/WrynChristmas +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -############################## - -foreground='CCDDFF' -background='001010' - -red='A2152D' -brightred='FF1440' - -green='288B52' -brightgreen='55C9B5' - -yellow='489358' -brightyellow='5BF887' - -blue='0EA1EE' -brightblue='00FFFF' - -magenta='A03C6F' -brightmagenta='CF4663' - -cyan='8195A2' -brightcyan='DFF5FE' - -gray='486A8A' -brightgray='EBFFF2' - -############################## - - -if [ "$TERM" = "linux" ]; then - /bin/echo -e " - \e]P0$background - \e]P1$red - \e]P2$green - \e]P3$yellow - \e]P4$blue - \e]P5$magenta - \e]P6$cyan - \e]P7$foreground - \e]P8$brightred - \e]P9$brightgreen - \e]PA$brightyellow - \e]PB$brightblue - \e]PC$brightmagenta - \e]PD$brightcyan - \e]PE$gray - \e]PF$brightgray - " - clear; -fi diff --git a/config/colorschemes/linux_console/WrynHalloween b/config/colorschemes/linux_console/WrynHalloween deleted file mode 100644 index 0318689..0000000 --- a/config/colorschemes/linux_console/WrynHalloween +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -background='22002a'; -foreground='ffffff'; - -red='5fff00'; -brightred='3a3a3a'; - -green='e17000'; -brightgreen='dd9210'; - -yellow='ff7a48'; -brightyellow='ff8200'; - -blue='ff0000'; -brightblue='edb877'; - -magenta='ff4e4e'; -brightmagenta='aa005c'; - -cyan='8a41d5'; -brightcyan='cc00ff'; - -gray='0da4cd'; -brightgray='acacac'; - -if [ "$TERM" = "linux" ]; then - /bin/echo -e " - \e]P0$background - \e]P1$red - \e]P2$green - \e]P3$yellow - \e]P4$blue - \e]P5$magenta - \e]P6$cyan - \e]P7$foreground - \e]P8$brightred - \e]P9$brightgreen - \e]PA$brightyellow - \e]PB$brightblue - \e]PC$brightmagenta - \e]PD$brightcyan - \e]PE$gray - \e]PF$brightgray - " - clear; -fi - diff --git a/config/colorschemes/linux_console/WrynValentines b/config/colorschemes/linux_console/WrynValentines deleted file mode 100644 index 0f94030..0000000 --- a/config/colorschemes/linux_console/WrynValentines +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -############################## - -foreground='E3DFD2' -background='150015' - -red='DB133F' -brightred='DF5472' - -green='DC39DC' -brightgreen='ED7BEE' - -yellow='7918F4' -brightyellow='7D72FE' - -blue='951255' -brightblue='E75BA2' - -magenta='7D1295' -brightmagenta='934BA3' - -cyan='DEB88D' -brightcyan='FEE3CD' - -gray='460020' -brightgray='900045' - -############################## - - -if [ "$TERM" = "linux" ]; then - /bin/echo -e " - \e]P0$background - \e]P1$red - \e]P2$green - \e]P3$yellow - \e]P4$blue - \e]P5$magenta - \e]P6$cyan - \e]P7$foreground - \e]P8$brightred - \e]P9$brightgreen - \e]PA$brightyellow - \e]PB$brightblue - \e]PC$brightmagenta - \e]PD$brightcyan - \e]PE$gray - \e]PF$brightgray - " - clear; -fi diff --git a/zsh/colors b/zsh/colors index 8823d2d..1822eeb 100644 --- a/zsh/colors +++ b/zsh/colors @@ -30,23 +30,29 @@ PS1="$PREVIOUS_COMMAND_CONDITION $USER $SEPARATOR $DIRECTORY $GIT_BRANCH $PROMPT ###################################################################################### -TTY_COLORSCHEME="$HOME/.config/wryn/tty-colorscheme" -[ ! -f $TTY_COLORSCHEME ] && ln -s $DOTWRYN/config/colorschemes/linux_console/CurrentKitty $TTY_COLORSCHEME -source $TTY_COLORSCHEME +source "$DOTWRYN/config/colorschemes/linux-console" alias tty-change-theme='TTY_CHANGE_THEME' function TTY_CHANGE_THEME() { - local SOURCE_THEME="$DOTWRYN/config/colorschemes/linux_console/$1" - local LOCAL_THEME="$HOME/.config/wryn/tty-colorscheme" + local TARGET_THEME_LINK="$HOME/.config/wryn/tty-colorscheme" + local SOURCE_THEME="$DOTWRYN/config/colorschemes/kitty/$1" [ ! $1 ] && { echo must specify colorscheme; return 1; } - [ ! -f $SOURCE_THEME ] && { echo no such colorscheme; return 2; } - rm $LOCAL_THEME >/dev/null 2>&1 - ln -s $SOURCE_THEME $LOCAL_THEME - source $LOCAL_THEME + + [[ $1 =~ ^current-kitty-theme$ ]] && { + rm $TARGET_THEME_LINK >/dev/null 2>&1 + } || { + [ ! -f $SOURCE_THEME ] && { echo no such colorscheme; return 2; } + + rm $TARGET_THEME_LINK >/dev/null 2>&1 + ln -s $SOURCE_THEME $TARGET_THEME_LINK + } + + echo 'TTY colorscheme updated; resource shell in TTY for changes to take effect' + source "$DOTWRYN/config/colorschemes/linux-console" } _TTY_CHANGE_THEME() { - compadd $(ls $DOTWRYN/config/colorschemes/linux_console) + compadd $(ls $DOTWRYN/config/colorschemes/kitty) kitty-current-theme } compdef _TTY_CHANGE_THEME TTY_CHANGE_THEME;