diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index 00e0568..d489861 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc @@ -21,8 +21,7 @@ fi bspc config border_width 4 bspc config window_gap 12 -THEME=$(grep colors: ~/.config/alacritty/alacritty.yml | cut -d '*' -f 2) -sh ~/.config/bspwm/commands.sh theme "$THEME" +sh ~/.config/bspwm/commands.sh theme --set 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 361f722..7dfa787 100644 --- a/bspwm/.config/bspwm/commands.sh +++ b/bspwm/.config/bspwm/commands.sh @@ -11,11 +11,12 @@ BAR_HEIGHT=40 CMD="$1" shift +# Determine current theme +THEME= if [ -e "${CURRENT_THEME_PATH}" ]; then . "${CURRENT_THEME_PATH}" -else - THEME="${DEFAULT_THEME}" fi +THEME="${THEME:-$DEFAULT_THEME}" list_themes() { ( cd "$THEMES_PATH" && ls *-theme.sh | sed 's/-theme.sh$//' | sort ) @@ -31,7 +32,7 @@ if [ "$CMD" = theme -a "$1" = --next ]; then else THEME="$NEXT" fi -elif [ "$CMD" = theme ]; then +elif [ "$CMD" = theme -a "$1" != --set ]; then if [ "$1" = "" ]; then exit elif [ -e "${THEMES_PATH}/$1-theme.sh" ]; then @@ -46,7 +47,7 @@ THEME_PATH="${THEMES_PATH}/${THEME}-theme.sh" if [ -e "${THEME_PATH}" ]; then . "${THEME_PATH}" else - . "${THEME_PATH}/${DEFAULT_THEME}-theme.sh" + . "${THEMES_PATH}/${DEFAULT_THEME}-theme.sh" fi DMENU_ARGS="-nb ${BAR_BG} -nf ${BAR_FG} -sb ${BAR_ACTIVE} -sf ${BAR_FG} -fn ${DMENU_FONT}"