From 2ca24444910eaf0f343e22d0b833126c4dfae60e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pankowski?= Date: Tue, 21 Jul 2020 23:15:29 +0200 Subject: [PATCH] keep theme on reload (from alacritty) on unknown theme reload current --- bspwm/.config/bspwm/bspwmrc | 3 ++- bspwm/.config/bspwm/commands.sh | 27 +++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index 1fccfef..00e0568 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc @@ -21,7 +21,8 @@ fi bspc config border_width 4 bspc config window_gap 12 -sh ~/.config/bspwm/commands.sh dark-colors +THEME=$(grep colors: ~/.config/alacritty/alacritty.yml | cut -d '*' -f 2) +sh ~/.config/bspwm/commands.sh theme "$THEME" bspc config split_ratio 0.50 bspc config single_monocle true diff --git a/bspwm/.config/bspwm/commands.sh b/bspwm/.config/bspwm/commands.sh index 026c971..a24ec35 100644 --- a/bspwm/.config/bspwm/commands.sh +++ b/bspwm/.config/bspwm/commands.sh @@ -3,21 +3,20 @@ CMD="$1" shift -if [ "$CMD" = theme ]; then +if [ "$CMD" = theme -a "$1" = next ]; then + case $(bspc config focused_border_color) in + '#23aba4') + THEME=dark-blue + ;; + '#3585ce') + THEME=light + ;; + *) + THEME=dark + ;; + esac +elif [ "$CMD" = theme ] && [ "$1" = dark -o "$1" = dark-blue -o "$1" = light ]; then THEME="$1" - if [ "$THEME" = next ]; then - case $(bspc config focused_border_color) in - '#23aba4') - THEME=dark-blue - ;; - '#3585ce') - THEME=light - ;; - *) - THEME=dark - ;; - esac - fi else case $(bspc config focused_border_color) in '#068c70')