fix fallback to default theme, add theme option --set used in bspwmrc
This commit is contained in:
parent
ba583c8745
commit
2980f360b9
@ -21,8 +21,7 @@ fi
|
|||||||
bspc config border_width 4
|
bspc config border_width 4
|
||||||
bspc config window_gap 12
|
bspc config window_gap 12
|
||||||
|
|
||||||
THEME=$(grep colors: ~/.config/alacritty/alacritty.yml | cut -d '*' -f 2)
|
sh ~/.config/bspwm/commands.sh theme --set
|
||||||
sh ~/.config/bspwm/commands.sh theme "$THEME"
|
|
||||||
|
|
||||||
bspc config split_ratio 0.50
|
bspc config split_ratio 0.50
|
||||||
bspc config single_monocle true
|
bspc config single_monocle true
|
||||||
|
@ -11,11 +11,12 @@ BAR_HEIGHT=40
|
|||||||
CMD="$1"
|
CMD="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
|
# Determine current theme
|
||||||
|
THEME=
|
||||||
if [ -e "${CURRENT_THEME_PATH}" ]; then
|
if [ -e "${CURRENT_THEME_PATH}" ]; then
|
||||||
. "${CURRENT_THEME_PATH}"
|
. "${CURRENT_THEME_PATH}"
|
||||||
else
|
|
||||||
THEME="${DEFAULT_THEME}"
|
|
||||||
fi
|
fi
|
||||||
|
THEME="${THEME:-$DEFAULT_THEME}"
|
||||||
|
|
||||||
list_themes() {
|
list_themes() {
|
||||||
( cd "$THEMES_PATH" && ls *-theme.sh | sed 's/-theme.sh$//' | sort )
|
( cd "$THEMES_PATH" && ls *-theme.sh | sed 's/-theme.sh$//' | sort )
|
||||||
@ -31,7 +32,7 @@ if [ "$CMD" = theme -a "$1" = --next ]; then
|
|||||||
else
|
else
|
||||||
THEME="$NEXT"
|
THEME="$NEXT"
|
||||||
fi
|
fi
|
||||||
elif [ "$CMD" = theme ]; then
|
elif [ "$CMD" = theme -a "$1" != --set ]; then
|
||||||
if [ "$1" = "" ]; then
|
if [ "$1" = "" ]; then
|
||||||
exit
|
exit
|
||||||
elif [ -e "${THEMES_PATH}/$1-theme.sh" ]; then
|
elif [ -e "${THEMES_PATH}/$1-theme.sh" ]; then
|
||||||
@ -46,7 +47,7 @@ THEME_PATH="${THEMES_PATH}/${THEME}-theme.sh"
|
|||||||
if [ -e "${THEME_PATH}" ]; then
|
if [ -e "${THEME_PATH}" ]; then
|
||||||
. "${THEME_PATH}"
|
. "${THEME_PATH}"
|
||||||
else
|
else
|
||||||
. "${THEME_PATH}/${DEFAULT_THEME}-theme.sh"
|
. "${THEMES_PATH}/${DEFAULT_THEME}-theme.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DMENU_ARGS="-nb ${BAR_BG} -nf ${BAR_FG} -sb ${BAR_ACTIVE} -sf ${BAR_FG} -fn ${DMENU_FONT}"
|
DMENU_ARGS="-nb ${BAR_BG} -nf ${BAR_FG} -sb ${BAR_ACTIVE} -sf ${BAR_FG} -fn ${DMENU_FONT}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user