~mil/mepo-devel

mepo: Make Geoclue timeout configurable v1 APPLIED

Nguyễn Gia Phong: 1
 Make Geoclue timeout configurable

 1 files changed, 6 insertions(+), 9 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~mil/mepo-devel/patches/36166/mbox | git am -3
Learn more about email & git

[PATCH mepo] Make Geoclue timeout configurable Export this patch

Stop executing where-am-i in the background since there isn't
seem to be a reason to do so.
---
 scripts/mepo_ui_menu_user_pin_updater.sh | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/scripts/mepo_ui_menu_user_pin_updater.sh b/scripts/mepo_ui_menu_user_pin_updater.sh
index 09ce16b16c1d..24fed64e3fe2 100755
--- a/scripts/mepo_ui_menu_user_pin_updater.sh
+++ b/scripts/mepo_ui_menu_user_pin_updater.sh
@@ -13,6 +13,7 @@ DOC='
[ -z "$MEPO_USERPIN_ENABLED" ] && MEPO_USERPIN_ENABLED="1"
[ -z "$MEPO_ENDPOINT_MLS" ] && MEPO_ENDPOINT_MLS="https://location.services.mozilla.com/v1/geolocate"
[ -z "$MEPO_APIKEY_MLS" ] && MEPO_APIKEY_MLS="9a418f3c-364a-418a-85e8-1bde733f0c88"
[ -z "$MEPO_TIMEOUT_GEOCLUE" ] && MEPO_TIMEOUT_GEOCLUE="10"

coordsviamls() {
  MLSRESULT="$(
@@ -29,16 +30,12 @@ coordsviageoclue() {

  /usr/libexec/geoclue-2.0/demos/agent > /dev/null &
  AGENTPID=$!
  LATLON="$(
          ( /usr/libexec/geoclue-2.0/demos/where-am-i -t 10 & ) |
          grep -E "Latitude|Longitude:" -m2 |
          cut -d: -f2 |
          tr -d "° " |
          tr "\n" " "
  )"
  /usr/libexec/geoclue-2.0/demos/where-am-i -t $MEPO_TIMEOUT_GEOCLUE |
    grep -E "Latitude|Longitude:" -m2 |
    cut -d: -f2 |
    tr -d "° " |
    tr "\n" " "
  kill -9 $AGENTPID
  pkill -9 -f where-am-i
  echo "$LATLON"
}

supportsgeoclue() {
-- 
2.37.3