Fill out gpsgeoclutget fn to call where-am-i to get current lat/lon
This commit is contained in:
parent
1d13cb6379
commit
061d253838
2 changed files with 21 additions and 3 deletions
|
@ -174,7 +174,7 @@ programchoicesinit() {
|
||||||
Map Type ^ 0 ^ sxmo_gpsutil.sh menumaptype
|
Map Type ^ 0 ^ sxmo_gpsutil.sh menumaptype
|
||||||
Panel Toggle ^ 1 ^ key m
|
Panel Toggle ^ 1 ^ key m
|
||||||
GPSD Toggle ^ 1 ^ key a
|
GPSD Toggle ^ 1 ^ key a
|
||||||
Locate Me ^ 0 ^ sxmo_gpsutil.sh locateme
|
Locate Me ^ 0 ^ sxmo_gpsutil.sh gpsgeoclueset
|
||||||
'
|
'
|
||||||
WINNAME=Maps
|
WINNAME=Maps
|
||||||
else
|
else
|
||||||
|
|
|
@ -55,6 +55,9 @@ killexistingfoxtrotgps() {
|
||||||
ACTIVEWIN="$(xdotool getactivewindow)"
|
ACTIVEWIN="$(xdotool getactivewindow)"
|
||||||
WMCLASS="$(xprop -id "$ACTIVEWIN" | grep WM_CLASS | cut -d ' ' -f3-)"
|
WMCLASS="$(xprop -id "$ACTIVEWIN" | grep WM_CLASS | cut -d ' ' -f3-)"
|
||||||
if echo "$WMCLASS" | grep -i foxtrot; then
|
if echo "$WMCLASS" | grep -i foxtrot; then
|
||||||
|
# E.g. by focusing back and refocuing forward we preserve ordering in stack
|
||||||
|
xdotool key Alt+k
|
||||||
|
xdotool key Alt+j
|
||||||
xdotool windowkill "$ACTIVEWIN" && return 0
|
xdotool windowkill "$ACTIVEWIN" && return 0
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
|
@ -98,9 +101,24 @@ gpslatlonset() {
|
||||||
gsettings set org.foxtrotgps global-y "$Y"
|
gsettings set org.foxtrotgps global-y "$Y"
|
||||||
killexistingfoxtrotgps && st -e foxtrotgps --lat="$LAT" --lon="$LON" &
|
killexistingfoxtrotgps && st -e foxtrotgps --lat="$LAT" --lon="$LON" &
|
||||||
}
|
}
|
||||||
gpsgeoclueget() {
|
gpsgeoclueset() {
|
||||||
# Will retrieve and set latlon from geoclue
|
# Will retrieve and set latlon from geoclue
|
||||||
echo foo
|
LATLON="$(
|
||||||
|
( /usr/libexec/geoclue-2.0/demos/where-am-i -t 10 & ) |
|
||||||
|
grep -E "Latitude|Longitude:" -m2 |
|
||||||
|
cut -d: -f2 |
|
||||||
|
tr -d " "
|
||||||
|
)"
|
||||||
|
pkill -f where-am-i
|
||||||
|
|
||||||
|
if echo "$LATLON" | grep .; then
|
||||||
|
LAT="$(echo "$LATLON" | head -n1)"
|
||||||
|
LON="$(echo "$LATLON" | tail -n1)"
|
||||||
|
notify-send "You're at $LAT $LON, refocusing map"
|
||||||
|
gpslatlonset "$LAT $LON 14"
|
||||||
|
else
|
||||||
|
notify-send "Failed to retrieve coordinates from geoclue"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
copy() {
|
copy() {
|
||||||
COORDS="$(gpslatlonget)"
|
COORDS="$(gpslatlonget)"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue