diff --git a/bin/desktop/kitty/alternate-terminal.sh b/bin/desktop/kitty/alternate-terminal.sh new file mode 100755 index 0000000..76fd3a1 --- /dev/null +++ b/bin/desktop/kitty/alternate-terminal.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +CONFIG_DIR="$HOME/.wryn/config/kitty" + +[ -f "$CONFIG_DIR/temp.conf" ] && return 1 # race condition lock + +mv "$CONFIG_DIR/theme.conf" "$CONFIG_DIR/temp.conf" +mv "$CONFIG_DIR/alternate.conf" "$CONFIG_DIR/theme.conf" + +i3-sensible-terminal & +sleep 0.1 + +mv "$CONFIG_DIR/theme.conf" "$CONFIG_DIR/alternate.conf" +mv "$CONFIG_DIR/temp.conf" "$CONFIG_DIR/theme.conf" diff --git a/config/i3/config b/config/i3/config index b8cd8cf..14b7ccc 100644 --- a/config/i3/config +++ b/config/i3/config @@ -211,6 +211,7 @@ client.placeholder $PLACEHOLDER_BORDER $PLACEHOLDER_BACKGROUND $PLACEHOLDER_TEXT # Terminal / Application Launcher bindsym $mod+Return exec i3-sensible-terminal +bindsym $mod+shift+Return exec --no-startup-id $UTILS alternateterm bindsym $mod+space exec --no-startup-id dmenu_run -fn 'DejaVu Sans Mono-25' diff --git a/config/i3/utils b/config/i3/utils index 3c1a813..75b90ac 100755 --- a/config/i3/utils +++ b/config/i3/utils @@ -19,6 +19,8 @@ LOG_OUT="$UTIL_BIN/i3/logout.sh"; BG_RANDOMIZE="$UTIL_BIN/feh/randomize-background.sh" +ALTERNATE_TERMINAL="$UTIL_BIN/kitty/alternate-terminal.sh" + case $1 in next ) "$MEDIA__NEXT" ;; @@ -37,4 +39,6 @@ case $1 in logout ) "$LOG_OUT" ;; bgrandomize ) "$BG_RANDOMIZE" ;; + + alternateterm ) "$ALTERNATE_TERMINAL" ;; esac diff --git a/config/kitty/alternate.conf b/config/kitty/alternate.conf new file mode 120000 index 0000000..cf2a603 --- /dev/null +++ b/config/kitty/alternate.conf @@ -0,0 +1 @@ +/home/w0ryn/.wryn/config/colorschemes/kitty/WrynValentines.conf \ No newline at end of file diff --git a/zsh/colors b/zsh/colors index 48ed750..7d55c66 100644 --- a/zsh/colors +++ b/zsh/colors @@ -30,13 +30,18 @@ PS1="$PREVIOUS_COMMAND_CONDITION $USER $SEPARATOR $DIRECTORY $GIT_BRANCH $PROMPT ###################################################################################### +alias change_kitty_theme='KITTY_CHANGE_THEME default' +alias change_alternate_kitty_theme='KITTY_CHANGE_THEME alternate' function KITTY_CHANGE_THEME () { - [ ! $1 ] && echo no filename given :c && return 1; - [ ! -f "$DOTWRYN/config/colorschemes/kitty/$1" ] \ + [ ! $2 ] && echo no filename given :c && return 1; + [ ! -f "$DOTWRYN/config/colorschemes/kitty/$2" ] \ && echo colorscheme not supported && return 2; - rm $DOTWRYN/config/kitty/theme.conf - ln -s "$DOTWRYN/config/colorschemes/kitty/$1" "$DOTWRYN/config/kitty/theme.conf"\ + local THEME_DIR="$DOTWRYN/config/kitty"; + local THEME; + [ $1 = 'default' ] && THEME="$THEME_DIR/theme.conf" || THEME="$THEME_DIR/alternate.conf" + rm "$THEME" + ln -s "$DOTWRYN/config/colorschemes/kitty/$2" "$THEME"\ && echo 'theme changed successfully! (effective on new terminal session)' } _KITTY_CHANGE_THEME () {