split each theme to its own file
easier creating of new themes by just putting new file in themes directory having "-theme.sh" suffix
This commit is contained in:
parent
836b990c25
commit
f54c3cb735
@ -4,7 +4,7 @@ env:
|
||||
TERM: xterm-256color
|
||||
|
||||
schemas:
|
||||
lupan_dark: &dark
|
||||
lupan_dark: &lupan-dark
|
||||
primary:
|
||||
background: '#1a3a34'
|
||||
foreground: '#c8cfce'
|
||||
@ -26,7 +26,7 @@ schemas:
|
||||
magenta: '#e4b2e5'
|
||||
cyan: '#b2e5e5'
|
||||
white: '#ffffff'
|
||||
lupan_dark_blue: &dark-blue
|
||||
lupan_dark_blue: &lupan-dark-blue
|
||||
primary:
|
||||
background: '#092e50'
|
||||
foreground: '#c8cccf'
|
||||
@ -40,13 +40,13 @@ schemas:
|
||||
cyan: '#9fc5c5'
|
||||
white: '#c8cccf'
|
||||
bright: *bright-colors
|
||||
lupan_dark_gray: &dark-gray
|
||||
lupan_dark_gray: &lupan-dark-gray
|
||||
primary:
|
||||
background: '#474c51'
|
||||
foreground: '#c8cccf'
|
||||
normal: *dark-normal-colors
|
||||
bright: *bright-colors
|
||||
lupan_material_dark: &material-dark
|
||||
lupan_material_dark: &lupan-material-dark
|
||||
primary:
|
||||
background: '#424242'
|
||||
foreground: '#eeeeee'
|
||||
@ -60,7 +60,7 @@ schemas:
|
||||
cyan: '#80deea'
|
||||
white: '#fafafa'
|
||||
bright: *bright-colors
|
||||
lupan_light: &light
|
||||
lupan_light: &lupan-light
|
||||
primary:
|
||||
background: '#f2f6e1'
|
||||
foreground: '#1a3a34'
|
||||
@ -74,7 +74,7 @@ schemas:
|
||||
cyan: '#59a6a6'
|
||||
white: '#f2f6e1'
|
||||
bright: *material-dark-normal
|
||||
lupan_material_light: &material-light
|
||||
lupan_material_light: &lupan-material-light
|
||||
primary:
|
||||
background: '#fafafa'
|
||||
foreground: '#424242'
|
||||
@ -89,7 +89,7 @@ schemas:
|
||||
white: '#fafafa'
|
||||
bright: *bright-colors
|
||||
|
||||
colors: *dark
|
||||
colors: *lupan-dark
|
||||
|
||||
font:
|
||||
size: 13.5
|
||||
|
@ -1,104 +1,55 @@
|
||||
#!/bin/sh
|
||||
|
||||
THEMES_PATH=~/.config/bspwm/themes
|
||||
CURRENT_THEME_PATH="${THEMES_PATH}/theme.sh"
|
||||
DEFAULT_THEME=lupan-dark
|
||||
|
||||
DMENU_FONT=Iosevka:pixelsize=30
|
||||
BAR_FONT='Iosevka:size=22:antialias=true:autohint=true;5'
|
||||
BAR_HEIGHT=40
|
||||
|
||||
CMD="$1"
|
||||
shift
|
||||
|
||||
if [ "$CMD" = theme -a "$1" = next ]; then
|
||||
case $(bspc config focused_border_color) in
|
||||
'#9fc5be') THEME=dark-blue ;;
|
||||
'#9fb3c5') THEME=dark-gray ;;
|
||||
'#4c657f') THEME=light ;;
|
||||
'#97a559') THEME=material-dark ;;
|
||||
'#78909c') THEME=material-light ;;
|
||||
*) THEME=dark ;;
|
||||
esac
|
||||
elif [ "$CMD" = theme -a "$1" = "" ]; then
|
||||
exit
|
||||
elif [ "$CMD" = theme ] && [ "$1" = dark -o "$1" = dark-blue -o "$1" = dark-gray -o "$1" = light -o "$1" = material-dark -o "$1" = material-light ]; then
|
||||
if [ -e "${CURRENT_THEME_PATH}" ]; then
|
||||
. "${CURRENT_THEME_PATH}"
|
||||
else
|
||||
THEME="${DEFAULT_THEME}"
|
||||
fi
|
||||
|
||||
list_themes() {
|
||||
( cd "$THEMES_PATH" && ls *-theme.sh | sed 's/-theme.sh$//' | sort )
|
||||
}
|
||||
|
||||
# Select next or named theme
|
||||
if [ "$CMD" = theme -a "$1" = --next ]; then
|
||||
NEXT=$(list_themes | grep -A 1 "^${THEME}\$" | tail -1)
|
||||
if [ "$NEXT" = "$THEME" ]; then
|
||||
THEME=$(list_themes | head -1)
|
||||
elif [ "$THEME" = "" ]; then
|
||||
THEME="${DEFAULT_THEME}"
|
||||
else
|
||||
THEME="$NEXT"
|
||||
fi
|
||||
echo "THEME=${THEME}" > "${CURRENT_THEME_PATH}"
|
||||
elif [ "$CMD" = theme ]; then
|
||||
if [ -e "${THEMES_PATH}/$1-theme.sh" ]; then
|
||||
THEME="$1"
|
||||
else
|
||||
case $(bspc config focused_border_color) in
|
||||
'#9fb3c5') THEME=dark-blue ;;
|
||||
'#4c657f') THEME=dark-gray ;;
|
||||
'#97a559') THEME=light ;;
|
||||
'#78909c') THEME=material-dark ;;
|
||||
'#b0bec5') THEME=material-light ;;
|
||||
*) THEME=dark ;;
|
||||
esac
|
||||
THEME="${DEFAULT_THEME}"
|
||||
fi
|
||||
echo "THEME=${THEME}" > "${CURRENT_THEME_PATH}"
|
||||
fi
|
||||
|
||||
FONT=Iosevka:pixelsize=30
|
||||
BAR_FONT='Iosevka:size=22:antialias=true:autohint=true;5'
|
||||
BAR_HEIGHT=40
|
||||
|
||||
if [ "$THEME" = light ]; then
|
||||
ROOT_BG=#e5e5e5
|
||||
BAR_BG=#d8e0b7
|
||||
BAR_FG=#97a559
|
||||
BAR_ACTIVE=#ebefdb
|
||||
BAR_URGENT=#e0b7b7
|
||||
BAR_EMPTY=#7f7f7f
|
||||
NORMAL_BORDER=#7f7f7f
|
||||
FOCUS_BORDER=#97a559
|
||||
EMACS_THEME=lupan-light
|
||||
GTK_THEME=Materia-light
|
||||
elif [ "$THEME" = material-light ]; then
|
||||
ROOT_BG=#fafafa
|
||||
BAR_BG=#cfd8dc
|
||||
BAR_FG=#424242
|
||||
BAR_ACTIVE=#eceff1
|
||||
BAR_URGENT=#ef5350
|
||||
BAR_EMPTY=#bdbdbd
|
||||
NORMAL_BORDER=#bdbdbd
|
||||
FOCUS_BORDER=#b0bec5
|
||||
EMACS_THEME=lupan-material-light
|
||||
GTK_THEME=Materia-light
|
||||
elif [ "$THEME" = dark-blue ]; then
|
||||
ROOT_BG=#4c4c4c
|
||||
BAR_BG=#394d5f
|
||||
BAR_FG=#9fb3c5
|
||||
BAR_ACTIVE=#4c677f
|
||||
BAR_URGENT=#7f4c4c
|
||||
BAR_EMPTY=#767f88
|
||||
NORMAL_BORDER=#767f88
|
||||
FOCUS_BORDER=#9fb3c5
|
||||
EMACS_THEME=lupan-dark-blue
|
||||
GTK_THEME=Materia-dark
|
||||
elif [ "$THEME" = dark-gray ]; then
|
||||
ROOT_BG=#4c4c4c
|
||||
BAR_BG=#394c5f
|
||||
BAR_FG=#9fb2c5
|
||||
BAR_ACTIVE=#4c657f
|
||||
BAR_URGENT=#7f4c4c
|
||||
BAR_EMPTY=#767f88
|
||||
NORMAL_BORDER=#767f88
|
||||
FOCUS_BORDER=#4c657f
|
||||
EMACS_THEME=lupan-dark-gray
|
||||
GTK_THEME=Materia-dark
|
||||
elif [ "$THEME" = material-dark ]; then
|
||||
ROOT_BG=#212121
|
||||
BAR_BG=#455a64
|
||||
BAR_FG=#f2f6e1
|
||||
BAR_ACTIVE=#78909c
|
||||
BAR_URGENT=#ef5350
|
||||
BAR_EMPTY=#757575
|
||||
NORMAL_BORDER=#757575
|
||||
FOCUS_BORDER=#78909c
|
||||
EMACS_THEME=lupan-material-dark
|
||||
GTK_THEME=Materia-dark
|
||||
# Load theme
|
||||
THEME_PATH="${THEMES_PATH}/${THEME}-theme.sh"
|
||||
if [ -e "${THEME_PATH}" ]; then
|
||||
. "${THEME_PATH}"
|
||||
else
|
||||
ROOT_BG=#4c4c4c
|
||||
BAR_BG=#395f58
|
||||
BAR_FG=#9fc5be
|
||||
BAR_ACTIVE=#4c7f75
|
||||
BAR_URGENT=#7f4c4c
|
||||
BAR_EMPTY=#768885
|
||||
NORMAL_BORDER=#768885
|
||||
FOCUS_BORDER=#9fc5be
|
||||
EMACS_THEME=lupan-dark
|
||||
GTK_THEME=Materia-dark
|
||||
. "${THEME_PATH}/${DEFAULT_THEME}-theme.sh"
|
||||
fi
|
||||
DMENU_ARGS="-nb ${BAR_BG} -nf ${BAR_FG} -sb ${BAR_ACTIVE} -sf ${BAR_FG} -fn $FONT"
|
||||
|
||||
DMENU_ARGS="-nb ${BAR_BG} -nf ${BAR_FG} -sb ${BAR_ACTIVE} -sf ${BAR_FG} -fn ${DMENU_FONT}"
|
||||
|
||||
set_theme() {
|
||||
xrdb -merge <<EOF
|
||||
@ -116,9 +67,9 @@ EOF
|
||||
bspc config focused_border_color "${FOCUS_BORDER}"
|
||||
bspc config presel_feedback_color "${FOCUS_BORDER}"
|
||||
sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml
|
||||
emacsclient --eval "(my-select-theme '${EMACS_THEME})"
|
||||
sed -i -E "s#(Net/ThemeName) .*#\1 \"${GTK_THEME}\"#" ~/.config/xsettingsd/xsettingsd.conf
|
||||
pkill -HUP -x xsettingsd
|
||||
emacsclient --eval "(my-select-theme '${EMACS_THEME})"
|
||||
}
|
||||
|
||||
case "$CMD" in
|
||||
@ -133,6 +84,5 @@ case "$CMD" in
|
||||
| dmenu ${DMENU_ARGS} "$@" -l 20 -i -p Window: | cut -f 1 -d ' ')
|
||||
;;
|
||||
dmenu_theme)
|
||||
sh "$0" theme $(echo -n 'dark\ndark-blue\ndark-gray\nlight\nmaterial-dark\nmaterial-light\n' \
|
||||
| dmenu ${DMENU_ARGS} "$@" -p Theme:)
|
||||
sh "$0" theme $(list_themes | dmenu ${DMENU_ARGS} "$@" -p Theme:)
|
||||
esac
|
||||
|
11
bspwm/.config/bspwm/themes/lupan-dark-blue-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-dark-blue-theme.sh
Normal file
@ -0,0 +1,11 @@
|
||||
ROOT_BG=#4c4c4c
|
||||
BAR_BG=#394d5f
|
||||
BAR_FG=#9fb3c5
|
||||
BAR_ACTIVE=#4c677f
|
||||
BAR_URGENT=#7f4c4c
|
||||
BAR_EMPTY=#767f88
|
||||
NORMAL_BORDER=#767f88
|
||||
FOCUS_BORDER=#9fb3c5
|
||||
ALACRITTY_THEME=lupan-dark-blue
|
||||
EMACS_THEME=lupan-dark-blue
|
||||
GTK_THEME=Materia-dark
|
11
bspwm/.config/bspwm/themes/lupan-dark-gray-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-dark-gray-theme.sh
Normal file
@ -0,0 +1,11 @@
|
||||
ROOT_BG=#4c4c4c
|
||||
BAR_BG=#394c5f
|
||||
BAR_FG=#9fb2c5
|
||||
BAR_ACTIVE=#4c657f
|
||||
BAR_URGENT=#7f4c4c
|
||||
BAR_EMPTY=#767f88
|
||||
NORMAL_BORDER=#767f88
|
||||
FOCUS_BORDER=#4c657f
|
||||
ALACRITTY_THEME=lupan-dark-gray
|
||||
EMACS_THEME=lupan-dark-gray
|
||||
GTK_THEME=Materia-dark
|
11
bspwm/.config/bspwm/themes/lupan-dark-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-dark-theme.sh
Normal file
@ -0,0 +1,11 @@
|
||||
ROOT_BG=#4c4c4c
|
||||
BAR_BG=#395f58
|
||||
BAR_FG=#9fc5be
|
||||
BAR_ACTIVE=#4c7f75
|
||||
BAR_URGENT=#7f4c4c
|
||||
BAR_EMPTY=#768885
|
||||
NORMAL_BORDER=#768885
|
||||
FOCUS_BORDER=#9fc5be
|
||||
ALACRITTY_THEME=lupan-dark
|
||||
EMACS_THEME=lupan-dark
|
||||
GTK_THEME=Materia-dark
|
11
bspwm/.config/bspwm/themes/lupan-light-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-light-theme.sh
Normal file
@ -0,0 +1,11 @@
|
||||
ROOT_BG=#e5e5e5
|
||||
BAR_BG=#d8e0b7
|
||||
BAR_FG=#97a559
|
||||
BAR_ACTIVE=#ebefdb
|
||||
BAR_URGENT=#e0b7b7
|
||||
BAR_EMPTY=#7f7f7f
|
||||
NORMAL_BORDER=#7f7f7f
|
||||
FOCUS_BORDER=#97a559
|
||||
ALACRITTY_THEME=lupan-light
|
||||
EMACS_THEME=lupan-light
|
||||
GTK_THEME=Materia-light
|
11
bspwm/.config/bspwm/themes/lupan-material-dark-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-material-dark-theme.sh
Normal file
@ -0,0 +1,11 @@
|
||||
ROOT_BG=#212121
|
||||
BAR_BG=#455a64
|
||||
BAR_FG=#f2f6e1
|
||||
BAR_ACTIVE=#78909c
|
||||
BAR_URGENT=#ef5350
|
||||
BAR_EMPTY=#757575
|
||||
NORMAL_BORDER=#757575
|
||||
FOCUS_BORDER=#78909c
|
||||
ALACRITTY_THEME=lupan-material-dark
|
||||
EMACS_THEME=lupan-material-dark
|
||||
GTK_THEME=Materia-dark
|
11
bspwm/.config/bspwm/themes/lupan-material-light-theme.sh
Normal file
11
bspwm/.config/bspwm/themes/lupan-material-light-theme.sh
Normal file
@ -0,0 +1,11 @@
|
||||
ROOT_BG=#fafafa
|
||||
BAR_BG=#cfd8dc
|
||||
BAR_FG=#424242
|
||||
BAR_ACTIVE=#eceff1
|
||||
BAR_URGENT=#ef5350
|
||||
BAR_EMPTY=#bdbdbd
|
||||
NORMAL_BORDER=#bdbdbd
|
||||
FOCUS_BORDER=#b0bec5
|
||||
ALACRITTY_THEME=lupan-material-light
|
||||
EMACS_THEME=lupan-material-light
|
||||
GTK_THEME=Materia-light
|
@ -24,7 +24,7 @@ super + semicolon ; shift + {h,l,s}
|
||||
{systemctl hibernate,slock,systemctl suspend}
|
||||
|
||||
super + {_,shift + }F6
|
||||
sh ~/.config/bspwm/commands.sh {theme next,dmenu_theme}
|
||||
sh ~/.config/bspwm/commands.sh {theme --next,dmenu_theme}
|
||||
|
||||
XF86AudioPlay
|
||||
mpc toggle
|
||||
|
Loading…
x
Reference in New Issue
Block a user