add material dark and light themes and dmenu theme selection

This commit is contained in:
Łukasz Pankowski 2020-07-22 15:11:30 +02:00
parent 5f48b86e8f
commit a5c31eb87a
3 changed files with 66 additions and 22 deletions

View File

@ -32,6 +32,20 @@ schemas:
foreground: '#c0c0c0' foreground: '#c0c0c0'
normal: *dark-normal-colors normal: *dark-normal-colors
bright: *bright-colors bright: *bright-colors
lupan_material_dark: &material-dark
primary:
background: '#424242'
foreground: '#eeeeee'
normal: &material-dark-normal
black: '#212121'
red: '#ef9a9a'
green: '#a5d6a7'
yellow: '#fff59d'
blue: '#90caf9'
magenta: '#ce93d8'
cyan: '#80deea'
white: '#fafafa'
bright: *bright-colors
lupan_light: &light lupan_light: &light
primary: primary:
background: '#f2f6e1' background: '#f2f6e1'
@ -45,6 +59,20 @@ schemas:
magenta: '#a708d6' magenta: '#a708d6'
cyan: '#2081a0' cyan: '#2081a0'
white: '#f2f6e1' white: '#f2f6e1'
bright: *material-dark-normal
lupan_material_light: &material-light
primary:
background: '#fafafa'
foreground: '#424242'
normal:
black: '#212121'
red: '#e53935'
green: '#43a047'
yellow: '#f9a825'
blue: '#1e88e5'
magenta: '#8e24aa'
cyan: '#00acc1'
white: '#fafafa'
bright: *bright-colors bright: *bright-colors
colors: *dark colors: *dark

View File

@ -5,29 +5,21 @@ shift
if [ "$CMD" = theme -a "$1" = next ]; then if [ "$CMD" = theme -a "$1" = next ]; then
case $(bspc config focused_border_color) in case $(bspc config focused_border_color) in
'#23aba4') '#23aba4') THEME=dark-blue ;;
THEME=dark-blue '#3585ce') THEME=light ;;
;; '#068c70') THEME=material-dark ;;
'#3585ce') '#78909c') THEME=material-light ;;
THEME=light *) THEME=dark ;;
;;
*)
THEME=dark
;;
esac esac
elif [ "$CMD" = theme ] && [ "$1" = dark -o "$1" = dark-blue -o "$1" = light ]; then elif [ "$CMD" = theme ] && [ "$1" = dark -o "$1" = dark-blue -o "$1" = light -o "$1" = material-light -o "$1" = material-dark ]; then
THEME="$1" THEME="$1"
else else
case $(bspc config focused_border_color) in case $(bspc config focused_border_color) in
'#068c70') '#3585ce') THEME=dark-blue ;;
THEME=light '#068c70') THEME=light ;;
;; '#78909c') THEME=material-dark ;;
'#3585ce') '#827717') THEME=material-light ;;
THEME=dark-blue *) THEME=dark ;;
;;
*)
THEME=dark
;;
esac esac
fi fi
@ -45,6 +37,16 @@ if [ "$THEME" = light ]; then
NORMAL_BORDER=#b0b0b0 NORMAL_BORDER=#b0b0b0
FOCUS_BORDER=#068c70 FOCUS_BORDER=#068c70
EMACS_THEME=lupan-light EMACS_THEME=lupan-light
elif [ "$THEME" = material-light ]; then
ROOT_BG=#f0f4c3
BAR_BG=#f9fbe7
BAR_FG=#424242
BAR_ACTIVE=#dce775
BAR_URGENT=#9b0640
BAR_EMPTY=#bdbdbd
NORMAL_BORDER=#bdbdbd
FOCUS_BORDER=#827717
EMACS_THEME=lupan-material-light
elif [ "$THEME" = dark-blue ]; then elif [ "$THEME" = dark-blue ]; then
ROOT_BG=#404040 ROOT_BG=#404040
BAR_BG=#1a343a BAR_BG=#1a343a
@ -55,6 +57,16 @@ elif [ "$THEME" = dark-blue ]; then
NORMAL_BORDER=#808080 NORMAL_BORDER=#808080
FOCUS_BORDER=#3585ce FOCUS_BORDER=#3585ce
EMACS_THEME=lupan-dark-blue EMACS_THEME=lupan-dark-blue
elif [ "$THEME" = material-dark ]; then
ROOT_BG=#37474f
BAR_BG=#263238
BAR_FG=#f2f6e1
BAR_ACTIVE=#78909c
BAR_URGENT=#9b0640
BAR_EMPTY=#9e9e9e
NORMAL_BORDER=#9e9e9e
FOCUS_BORDER=#78909c
EMACS_THEME=lupan-material-dark
else else
ROOT_BG=#404040 ROOT_BG=#404040
BAR_BG=#1a343a BAR_BG=#1a343a
@ -96,5 +108,9 @@ case "$CMD" in
;; ;;
dmenu_window) dmenu_window)
bspc node -f $(xtitle -f '%u %s\n' $(bspc query -N -n .window) \ bspc node -f $(xtitle -f '%u %s\n' $(bspc query -N -n .window) \
| dmenu ${DMENU_ARGS} "$@" -l 20 -i | cut -f 1 -d ' ') | dmenu ${DMENU_ARGS} "$@" -l 20 -i -p Window: | cut -f 1 -d ' ')
;;
dmenu_theme)
sh "$0" theme $(echo -n 'dark\ndark-blue\nlight\nmaterial-light\nmaterial-dark\n' \
|dmenu ${DMENU_ARGS} "$@" -l 20 -p Theme:)
esac esac

View File

@ -23,8 +23,8 @@ super + semicolon ; {e,f,t}
super + semicolon ; shift + {h,l,s} super + semicolon ; shift + {h,l,s}
{systemctl hibernate,slock,systemctl suspend} {systemctl hibernate,slock,systemctl suspend}
super + F6 super + {_,shift + }F6
sh ~/.config/bspwm/commands.sh theme next sh ~/.config/bspwm/commands.sh {theme next,dmenu_theme}
XF86AudioPlay XF86AudioPlay
mpc toggle mpc toggle