~mil/sxmo-utils

4814701e00618967a3f5f53e8c9f294154b6a441 — Miles Alan 1 year, 6 months ago 25cc04e
Kill existing foxtrotgps before setting new settings via gsettings
This should prevent foxtrotgps from saving (e.g. overriding parameters)
unintentionally between sessions
1 files changed, 9 insertions(+), 5 deletions(-)

M scripts/core/sxmo_gpsutil.sh
M scripts/core/sxmo_gpsutil.sh => scripts/core/sxmo_gpsutil.sh +9 -5
@@ 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
}