From 60814159c20851bad6fb9ddc191748d659ee6b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pankowski?= Date: Tue, 21 Jul 2020 21:34:44 +0200 Subject: [PATCH] add dark-blue theme --- alacritty/.config/alacritty/alacritty.yml | 28 +++++++++-- alacritty/.config/alacritty/set_theme.sh | 21 ++++++++ alacritty/.config/alacritty/switch_bg.py | 17 ------- bspwm/.config/bspwm/commands.sh | 61 +++++++++++++++-------- bspwm/.config/sxhkd/sxhkdrc | 2 +- 5 files changed, 88 insertions(+), 41 deletions(-) create mode 100755 alacritty/.config/alacritty/set_theme.sh delete mode 100755 alacritty/.config/alacritty/switch_bg.py diff --git a/alacritty/.config/alacritty/alacritty.yml b/alacritty/.config/alacritty/alacritty.yml index 24341dd..13534c1 100644 --- a/alacritty/.config/alacritty/alacritty.yml +++ b/alacritty/.config/alacritty/alacritty.yml @@ -4,7 +4,7 @@ env: TERM: xterm-256color schemas: - lupan_light: &dark + lupan_dark: &dark primary: background: '#1a3a34' foreground: '#f2f6e1' @@ -26,6 +26,28 @@ schemas: magenta: '#b056b5' cyan: '#169191' white: '#ffffff' + lupan_dark_blue: &dark-blue + primary: + background: '#092e50' + foreground: '#c0c0c0' + normal: + black: '#000000' + red: '#e6436d' + green: '#59c19f' + yellow: '#f6bc25' + blue: '#55b3fd' + magenta: '#dc88e9' + cyan: '#77adc4' + white: '#f2f6e1' + bright: + black: '#888888' + red: '#e694a9' + green: '#94e6a9' + yellow: '#fbda62' + blue: '#1081ff' + magenta: '#b056b5' + cyan: '#169191' + white: '#ffffff' lupan_light: &light primary: background: '#f2f6e1' @@ -49,7 +71,7 @@ schemas: cyan: '#169191' white: '#ffffff' -colors: *dark +colors: *dark font: size: 13.5 @@ -59,4 +81,4 @@ font: key_bindings: - key: F6 mods: Control|Shift - command: { program: "/bin/sh", args: ["-c", "~/.config/alacritty/switch_bg.py"] } + command: { program: "/bin/sh", args: ["-c", "~/.config/alacritty/set_theme.sh next"] } diff --git a/alacritty/.config/alacritty/set_theme.sh b/alacritty/.config/alacritty/set_theme.sh new file mode 100755 index 0000000..5bbe4d3 --- /dev/null +++ b/alacritty/.config/alacritty/set_theme.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +case "$1" in + dark|dark-blue|light) + sed -i "s/^colors: [*].*/colors: *$1/" ~/.config/alacritty/alacritty.yml + ;; + next) + case $(grep colors: ~/.config/alacritty/alacritty.yml) in + 'colors: *dark') + THEME=dark-blue + ;; + 'colors: *dark-blue') + THEME=light + ;; + *) + THEME=dark + ;; + esac + sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml + ;; +esac diff --git a/alacritty/.config/alacritty/switch_bg.py b/alacritty/.config/alacritty/switch_bg.py deleted file mode 100755 index 328cf79..0000000 --- a/alacritty/.config/alacritty/switch_bg.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/python3 - -import os -import sys - -action = 'switch' -if len(sys.argv) > 1: - action = sys.argv[1] -path = os.path.join(os.getenv('HOME'), '.config/alacritty/alacritty.yml') -with open(path, 'r+') as f: - cfg = f.read() - if "colors: *dark" in cfg and action in ['switch', 'light']: - cfg = cfg.replace("colors: *dark", "colors: *light") - elif "colors: *light" in cfg and action in ['switch', 'dark']: - cfg = cfg.replace("colors: *light", "colors: *dark") - f.seek(0) - f.write(cfg) diff --git a/bspwm/.config/bspwm/commands.sh b/bspwm/.config/bspwm/commands.sh index 4d383b9..026c971 100644 --- a/bspwm/.config/bspwm/commands.sh +++ b/bspwm/.config/bspwm/commands.sh @@ -3,29 +3,40 @@ CMD="$1" shift -is_light() { - bspc config focused_border_color | grep '#068c70' > /dev/null -} - -if [ "$CMD" = switch-colors ]; then - if is_light; then - CMD=dark-colors - SCHEME=dark - else - CMD=light-colors - SCHEME=light +if [ "$CMD" = theme ]; 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 -elif is_light; then - SCHEME=light else - SCHEME=dark + case $(bspc config focused_border_color) in + '#068c70') + THEME=light + ;; + '#3585ce') + THEME=dark-blue + ;; + *) + THEME=dark + ;; + esac fi FONT=Iosevka:pixelsize=30 BAR_FONT='Iosevka:pixelsize=23:antialias=true:autohint=true;5' BAR_HEIGHT=40 -if [ "$SCHEME" = light ]; then +if [ "$THEME" = light ]; then ROOT_BG=#c1e6c2 BAR_BG=#e1e6d2 BAR_FG=#1a343a @@ -35,7 +46,7 @@ if [ "$SCHEME" = light ]; then NORMAL_BORDER=#b0b0b0 FOCUS_BORDER=#068c70 EMACS_THEME=lupan-light -else +elif [ "$THEME" = dark-blue ]; then ROOT_BG=#404040 BAR_BG=#1a343a BAR_FG=#f2f6e1 @@ -44,11 +55,21 @@ else BAR_EMPTY=#808080 NORMAL_BORDER=#808080 FOCUS_BORDER=#3585ce + EMACS_THEME=lupan-dark-blue +else + ROOT_BG=#404040 + BAR_BG=#1a343a + BAR_FG=#f2f6e1 + BAR_ACTIVE=#23aba4 + BAR_URGENT=#9b0640 + BAR_EMPTY=#808080 + NORMAL_BORDER=#808080 + FOCUS_BORDER=#23aba4 EMACS_THEME=lupan-dark fi DMENU_ARGS="-nb ${BAR_BG} -nf ${BAR_FG} -sb ${BAR_ACTIVE} -sf ${BAR_FG} -fn $FONT" -switch_colors() { +set_theme() { xrdb -merge <