From a0c030fe7c51474d2d80b1946d16f5dd4a5eb40a Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Mon, 15 Oct 2018 09:22:19 -0400 Subject: [PATCH] Make post-wal commands conditional This commit makes the post-wal script a bit more aware of its environment. This is only to support Plasma with bspwm, which needs the bspwm settings but not the dunst settings. Since bspwm with KDE settings performs exceptionally well, I may drop Plasma with bspwm support altogether and revert this commit at a later date. The overhead of wmctrl and grep may not be worth it. Additionally, the filename should probably be changed to a more generic one in order to support more software as needed. --- .config/wal/bspwm_and_dunst.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.config/wal/bspwm_and_dunst.sh b/.config/wal/bspwm_and_dunst.sh index c0a74d29..e16ef25c 100644 --- a/.config/wal/bspwm_and_dunst.sh +++ b/.config/wal/bspwm_and_dunst.sh @@ -3,12 +3,17 @@ # Source the colors from wal source "${HOME}/.cache/wal/colors.sh" -# Set the border colors -bspc config normal_border_color "$color1" -bspc config active_border_color "$color2" -bspc config focused_border_color "$color15" -bspc config presel_feedback_color "$color1" +# Set the border colors if bspwm is running +if [ -n "$(wmctrl -m | grep 'bspwm')" ]; then + bspc config normal_border_color "$color1" + bspc config active_border_color "$color2" + bspc config focused_border_color "$color15" + bspc config presel_feedback_color "$color1" +fi -# Restart dunst with the new color scheme -pkill dunst -dunst -conf "${HOME}/.cache/wal/dunstrc" +# Restart dunst with the new color scheme, only if +# we're not using Plasma +if ! [ "$DESKTOP_SESSION" == "Plasma" ]; then + pkill dunst + dunst -conf "${HOME}/.cache/wal/dunstrc" +fi