diff --git a/bin/mb-obthemes b/bin/mb-obthemes index a096e06..a36134b 100755 --- a/bin/mb-obthemes +++ b/bin/mb-obthemes @@ -613,7 +613,10 @@ function getGTKname(){ # get GTK theme name echo -e "\n Zapisano $TXT" echo "$TXT" >> "$LISTMSG" } - +function getMenuPanel() { + echo "configdir: $CONFIGDIR" + cp "$HOME"/.config/mabox/mabox.conf "$CONFIGDIR"/ +} function checkTint2(){ # kill or restart tint2s for screenshot, if necessary if [[ $1 = stop ]];then if ! cat "$SETTINGS" | grep "TINT2" &>/dev/null;then @@ -737,7 +740,9 @@ function restoreGTK(){ # $1 is chosen saved config dir i=$(($i+1)) done } - +function restoreMenuPanel() { +cp -a $1/mabox.conf $HOME/.config/mabox/mabox.conf +} function restoreOBrc(){ RCFILE="$OBPATH/rc.xml" THEMEFILE="$1/obtheme.txt" @@ -887,6 +892,8 @@ function saveSettings(){ ;; esac done + #save menu/panel settings + getMenuPanel SLOOP=0 fi fi @@ -1091,6 +1098,7 @@ function restoreSettings(){ done < "$SETCFG" openbox --reconfigure #mb-regenerate-menu + restoreMenuPanel "$FPATH" restoreSettings } diff --git a/bin/mb-setvar b/bin/mb-setvar index 07d2656..cb6f466 100755 --- a/bin/mb-setvar +++ b/bin/mb-setvar @@ -6,6 +6,8 @@ if [[ $# < 1 ]]; then self=$(basename $0) echo "Usage: $self variable=value [/PATH/TO/CONFIG_FILE]" + echo "Current configuration:" + cat $HOME/.config/mabox/mabox.conf exit 2 fi if [[ $1 != *"="* ]]; then @@ -15,13 +17,15 @@ if [[ $1 != *"="* ]]; then fi FILE=${2:-$HOME/.config/mabox/mabox.conf} - +echo $1 search=$(echo $1|cut -d= -f1) - +if [[ $search =~ "bottom_img" ]]; then +sed -i /^"$search="/d $FILE +fi if grep -Rq $search $FILE then #found sed -i s/^"$search=".*$/"$1"/ $FILE else #not found echo $1 >> $FILE fi - +cat $FILE