From 7a636dcfc633cdafb0b6c1ee370f317af87b3d5e Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Tue, 25 Jul 2023 14:23:08 +0200 Subject: [PATCH] fix obtctl --- bin/obtctl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/obtctl b/bin/obtctl index 1f2a594..50d76ea 100755 --- a/bin/obtctl +++ b/bin/obtctl @@ -3,8 +3,16 @@ OBTHEME=$(awk '// {while (getline n) {if (match(n, //)) {l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$HOME/.config/openbox/rc.xml") #echo "$OBTHEME" -THEMEDIR="$HOME/.themes/$OBTHEME/openbox-3" -THEMERC="$HOME/.themes/$OBTHEME/openbox-3/themerc" +if [[ $OBTHEME = MBcolor* ]];then +#switch to MBcolors theme + THEMEDIR="$HOME/.themes/$OBTHEME/openbox-3" + THEMERC="$HOME/.themes/$OBTHEME/openbox-3/themerc" + else + xmlstarlet ed -L -N o="http://openbox.org/3.4/rc" -u '/o:openbox_config/o:theme/o:name' -v "MBcolors" "$HOME/.config/openbox/rc.xml" + THEMEDIR="$HOME/.themes/MBcolors/openbox-3" + THEMERC="$HOME/.themes/MBcolors/openbox-3/themerc" +fi + MBCOLORSDIR="$HOME"/.themes/MBcolors/openbox-3/ if [ ! -d "$MBCOLORSDIR" ]; then @@ -419,7 +427,7 @@ fontslanttoggle (){ } randomizer () { - # TODO: - maybe put all options to cnf file and let users cistomize options??? + # TODO: - maybe put all options to cnf file and let users customize options??? ### ensure we use MBColors at the moment theme MBcolors