mb-obthemes take care of menu/sidepanels settings

master
Daniel Napora 2020-09-21 12:23:52 +02:00
parent 83e8e48944
commit eb8b75e395
2 changed files with 17 additions and 5 deletions

View File

@ -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
}

View File

@ -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