From 4814701e00618967a3f5f53e8c9f294154b6a441 Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Mon, 29 Jun 2020 18:41:31 -0500 Subject: [PATCH] Kill existing foxtrotgps before setting new settings via gsettings This should prevent foxtrotgps from saving (e.g. overriding parameters) unintentionally between sessions --- scripts/core/sxmo_gpsutil.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/core/sxmo_gpsutil.sh b/scripts/core/sxmo_gpsutil.sh index 1d6f423..fa4d3af 100755 --- a/scripts/core/sxmo_gpsutil.sh +++ b/scripts/core/sxmo_gpsutil.sh @@ -100,10 +100,13 @@ gpslatlonset() { Y="$(echo "$(lat2px "$LAT" "$ZOOM") - ($WINH / 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" - gsettings set org.foxtrotgps global-x "$X" - gsettings set org.foxtrotgps global-y "$Y" - killexistingfoxtrotgps && st -e foxtrotgps --lat="$LAT" --lon="$LON" & + killexistingfoxtrotgps + st -e sh -c " + gsettings set org.foxtrotgps global-zoom "$ZOOM"; + gsettings set org.foxtrotgps global-x "$X"; + gsettings set org.foxtrotgps global-y "$Y"; + foxtrotgps --lat="$LAT" --lon="$LON" + " & } gpsgeoclueset() { # Will retrieve and set latlon from geoclue @@ -221,8 +224,9 @@ menumaptype() { echo "$CHOICE" | grep "Close Menu" && exit 0 SETCHOICE="$(printf %b "$CHOICES" | grep "$CHOICE" | cut -d^ -f2 | awk '{$1=$1};1')" IDX="$(printf %b "$CHOICES" | grep -n "$CHOICE" | cut -d: -f1)" + killexistingfoxtrotgps gsettings set org.foxtrotgps repo-name "$SETCHOICE" - killexistingfoxtrotgps && st -e foxtrotgps & + st -e foxtrotgps & done }