Kill existing foxtrotgps before setting new settings via gsettings

This should prevent foxtrotgps from saving (e.g. overriding parameters)
unintentionally between sessions
master
Miles Alan 4 years ago
parent 25cc04e5d1
commit 4814701e00
  1. 14
      scripts/core/sxmo_gpsutil.sh

@ -100,10 +100,13 @@ gpslatlonset() {
Y="$(echo "$(lat2px "$LAT" "$ZOOM") - ($WINH / 2)" | bc -l | cut -d. -f1)" Y="$(echo "$(lat2px "$LAT" "$ZOOM") - ($WINH / 2)" | bc -l | cut -d. -f1)"
X="$(echo "$(lon2px "$LON" "$ZOOM") - ($WINW / 2)" | bc -l | cut -d. -f1)" X="$(echo "$(lon2px "$LON" "$ZOOM") - ($WINW / 2)" | bc -l | cut -d. -f1)"
gsettings set org.foxtrotgps global-zoom "$ZOOM" killexistingfoxtrotgps
gsettings set org.foxtrotgps global-x "$X" st -e sh -c "
gsettings set org.foxtrotgps global-y "$Y" gsettings set org.foxtrotgps global-zoom "$ZOOM";
killexistingfoxtrotgps && st -e foxtrotgps --lat="$LAT" --lon="$LON" & gsettings set org.foxtrotgps global-x "$X";
gsettings set org.foxtrotgps global-y "$Y";
foxtrotgps --lat="$LAT" --lon="$LON"
" &
} }
gpsgeoclueset() { gpsgeoclueset() {
# Will retrieve and set latlon from geoclue # Will retrieve and set latlon from geoclue
@ -221,8 +224,9 @@ menumaptype() {
echo "$CHOICE" | grep "Close Menu" && exit 0 echo "$CHOICE" | grep "Close Menu" && exit 0
SETCHOICE="$(printf %b "$CHOICES" | grep "$CHOICE" | cut -d^ -f2 | awk '{$1=$1};1')" SETCHOICE="$(printf %b "$CHOICES" | grep "$CHOICE" | cut -d^ -f2 | awk '{$1=$1};1')"
IDX="$(printf %b "$CHOICES" | grep -n "$CHOICE" | cut -d: -f1)" IDX="$(printf %b "$CHOICES" | grep -n "$CHOICE" | cut -d: -f1)"
killexistingfoxtrotgps
gsettings set org.foxtrotgps repo-name "$SETCHOICE" gsettings set org.foxtrotgps repo-name "$SETCHOICE"
killexistingfoxtrotgps && st -e foxtrotgps & st -e foxtrotgps &
done done
} }

Loading…
Cancel
Save