Add GPS reception test utility and OpenStreetMap GPS navigator plugin
This commit is contained in:
1 parent
be9ec9af0b
commit
35d90fb6f7
18 files changed
+1380
-5
No files matched your search
Executable
+65
@@ -0,0 +1,65 @@
|
||||
#!/bin/sh
|
||||
# Bananarchy GPS reception & coordinate detection CLI utility
|
||||
# Queries Qualcomm QDSP6 / ModemManager GNSS (gps-nmea + gps-raw + 3gpp-lac-ci).
|
||||
|
||||
ACTION="${1:-status}"
|
||||
|
||||
enable_gps() {
|
||||
mmcli -m any --location-enable-gps-nmea --location-enable-gps-raw >/dev/null 2>&1 || true
|
||||
mmcli -m any --location-set-gps-refresh-rate=2 >/dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
disable_gps() {
|
||||
mmcli -m any --location-disable-gps-nmea --location-disable-gps-raw >/dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
print_status() {
|
||||
enable_gps
|
||||
RAW="$(mmcli -m any -K --location-get 2>/dev/null)"
|
||||
if [ -z "$RAW" ]; then
|
||||
echo "GPS Status: Modem not ready"
|
||||
exit 1
|
||||
fi
|
||||
MCC="$(printf '%s\n' "$RAW" | awk -F': ' '/location\.3gpp\.mcc/{print $2}')"
|
||||
MNC="$(printf '%s\n' "$RAW" | awk -F': ' '/location\.3gpp\.mnc/{print $2}')"
|
||||
TAC="$(printf '%s\n' "$RAW" | awk -F': ' '/location\.3gpp\.tac/{print $2}')"
|
||||
CID="$(printf '%s\n' "$RAW" | awk -F': ' '/location\.3gpp\.cid/{print $2}')"
|
||||
LAT="$(printf '%s\n' "$RAW" | awk -F': ' '/location\.gps\.latitude/{print $2}')"
|
||||
LON="$(printf '%s\n' "$RAW" | awk -F': ' '/location\.gps\.longitude/{print $2}')"
|
||||
ALT="$(printf '%s\n' "$RAW" | awk -F': ' '/location\.gps\.altitude/{print $2}')"
|
||||
UTC="$(printf '%s\n' "$RAW" | awk -F': ' '/location\.gps\.utc/{print $2}')"
|
||||
echo "=== Bananarchy GNSS / GPS Reception Status ==="
|
||||
echo "3GPP Cell : MCC=${MCC:--} MNC=${MNC:--} TAC=${TAC:--} CID=${CID:--}"
|
||||
echo "GPS Fix : Lat=${LAT:---} Lon=${LON:---} Alt=${ALT:---}m UTC=${UTC:---}"
|
||||
echo "--- NMEA Sentences ---"
|
||||
printf '%s\n' "$RAW" | awk -F': ' '/location\.gps\.nmea\.value/{print $2}'
|
||||
}
|
||||
|
||||
case "$ACTION" in
|
||||
enable)
|
||||
enable_gps
|
||||
echo "GPS enabled (2s refresh)"
|
||||
;;
|
||||
disable)
|
||||
disable_gps
|
||||
echo "GPS disabled"
|
||||
;;
|
||||
nmea)
|
||||
enable_gps
|
||||
mmcli -m any -K --location-get 2>/dev/null | awk -F': ' '/location\.gps\.nmea\.value/{print $2}'
|
||||
;;
|
||||
watch)
|
||||
enable_gps
|
||||
while true; do
|
||||
clear
|
||||
print_status
|
||||
sleep 2
|
||||
done
|
||||
;;
|
||||
gui|open)
|
||||
exec xgps
|
||||
;;
|
||||
status|test|*)
|
||||
print_status
|
||||
;;
|
||||
esac
|
||||
Binary file not shown.
Symlink
+1
@@ -0,0 +1 @@
|
||||
dwm-plugin
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
dwm-plugin
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
dwm-plugin
|
||||
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -51,6 +51,12 @@ write_line_app bluetuith "$icon_bth Bluetuith" "sxmo_terminal.sh bluetuith"
|
||||
write_line_app calcurse "$icon_clk Calcurse" "sxmo_terminal.sh calcurse"
|
||||
write_line_app xcamera "$icon_cam Camera" "xcamera"
|
||||
write_line_app xmusic "$icon_mus Music" "xmusic"
|
||||
write_line_app xsip "$icon_phn SIP VoIP" "xsip"
|
||||
write_line_app xemail "$icon_eml Email" "xemail"
|
||||
write_line_app xirc "$icon_msg IRC Chat" "xirc"
|
||||
write_line_app xtox "$icon_msg Tox Messenger" "xtox"
|
||||
write_line_app xkopher "$icon_glb Kopher (SmallWeb)" "xkopher"
|
||||
write_line_app xgps "$icon_map GPS & Maps" "xgps"
|
||||
write_line_app celluloid "$icon_mvi Celluloid" "celluloid"
|
||||
write_line_app chatty "$icon_msg Chatty" "chatty"
|
||||
([ -z "$WAYLAND_DISPLAY" ] && command -v clipmenu >/dev/null) && \
|
||||
|
||||
Binary file not shown.
Symlink
+1
@@ -0,0 +1 @@
|
||||
dwm-plugin
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
dwm-plugin
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
dwm-plugin
|
||||
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -57,7 +57,9 @@ EOF
|
||||
glib-dev \
|
||||
cairo-dev \
|
||||
libjpeg-turbo-dev \
|
||||
libpng-dev >/dev/null
|
||||
libpng-dev \
|
||||
openssl-dev \
|
||||
toxcore-dev >/dev/null
|
||||
|
||||
export PKG_CONFIG_SYSROOT_DIR="$SYSROOT"
|
||||
export PKG_CONFIG_LIBDIR="$SYSROOT/usr/lib/pkgconfig:$SYSROOT/usr/share/pkgconfig"
|
||||
@@ -194,10 +196,43 @@ EOF
|
||||
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/locker.so &
|
||||
pids="$pids $!"
|
||||
|
||||
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||
/bananarchy/src/dwm-plugins/sip_plugin.cpp $NEOUI_LIBS $PLUG_LIBS -lssl -lcrypto -lpthread \
|
||||
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/sip.so &
|
||||
pids="$pids $!"
|
||||
|
||||
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||
/bananarchy/src/dwm-plugins/email_plugin.cpp $NEOUI_LIBS $PLUG_LIBS -lssl -lcrypto \
|
||||
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/email.so &
|
||||
pids="$pids $!"
|
||||
|
||||
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||
/bananarchy/src/dwm-plugins/irc_plugin.cpp $NEOUI_LIBS $PLUG_LIBS -lssl -lcrypto \
|
||||
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/irc.so &
|
||||
pids="$pids $!"
|
||||
|
||||
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||
/bananarchy/src/dwm-plugins/tox_plugin.cpp $NEOUI_LIBS $PLUG_LIBS -ltoxcore -lpthread \
|
||||
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/tox.so &
|
||||
pids="$pids $!"
|
||||
|
||||
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||
/bananarchy/src/dwm-plugins/smallweb_plugin.cpp $NEOUI_LIBS $PLUG_LIBS -lssl -lcrypto \
|
||||
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/smallweb.so &
|
||||
pids="$pids $!"
|
||||
|
||||
$CXX $CXX_PLUG_FLAGS $PLUG_INCS \
|
||||
/bananarchy/src/dwm-plugins/gps_plugin.cpp $NEOUI_LIBS $PLUG_LIBS $MEDIA_LIBS -lssl -lcrypto -lpthread \
|
||||
-o /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/gps.so &
|
||||
pids="$pids $!"
|
||||
|
||||
for pid in $pids; do
|
||||
wait "$pid"
|
||||
done
|
||||
|
||||
$STRIP --strip-unneeded "$SYSROOT"/usr/lib/libtoxcore.so.*.* || true
|
||||
cp -a "$SYSROOT"/usr/lib/libtoxcore.so* /bananarchy/prebuilt/sxmo-x11/usr/lib/
|
||||
|
||||
$STRIP --strip-unneeded \
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/libneoui.so \
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/xdrawer.so \
|
||||
@@ -214,7 +249,13 @@ EOF
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/ringtones.so \
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/wallpapers.so \
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/music.so \
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/locker.so
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/locker.so \
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/sip.so \
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/email.so \
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/irc.so \
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/tox.so \
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/smallweb.so \
|
||||
/bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/gps.so
|
||||
|
||||
$CC $OPT_CFLAGS -std=c99 -D_DEFAULT_SOURCE -Wall -Wextra \
|
||||
/bananarchy/src/dwm-plugins/dwm_plugin_runner.c -ldl \
|
||||
@@ -252,16 +293,29 @@ EOF
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xbackground
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xmusic
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xplayer
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xsip
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xemail
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xmail
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xirc
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xtox
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xkopher
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/kopher
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xsmallweb
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xgps
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xmaps
|
||||
ln -sf dwm-plugin /bananarchy/prebuilt/sxmo-x11/usr/bin/xnav
|
||||
|
||||
mkdir -p /bananarchy/overlay/rootfs/usr/bin /bananarchy/overlay/rootfs/usr/lib/dwm/plugins /bananarchy/overlay/rootfs/usr/include
|
||||
cp -a /bananarchy/prebuilt/sxmo-x11/usr/bin/. /bananarchy/overlay/rootfs/usr/bin/
|
||||
cp -f /bananarchy/prebuilt/sxmo-x11/usr/lib/libneoui.so /bananarchy/overlay/rootfs/usr/lib/libneoui.so
|
||||
cp -a /bananarchy/prebuilt/sxmo-x11/usr/lib/libtoxcore.so* /bananarchy/overlay/rootfs/usr/lib/
|
||||
cp -f /bananarchy/prebuilt/sxmo-x11/usr/include/neoui.h /bananarchy/overlay/rootfs/usr/include/neoui.h
|
||||
cp -a /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/. /bananarchy/overlay/rootfs/usr/lib/dwm/plugins/
|
||||
if [ -d /target-rootfs/usr/bin ]; then
|
||||
mkdir -p /target-rootfs/usr/lib/dwm/plugins /target-rootfs/usr/include
|
||||
cp -a /bananarchy/prebuilt/sxmo-x11/usr/bin/. /target-rootfs/usr/bin/
|
||||
cp -f /bananarchy/prebuilt/sxmo-x11/usr/lib/libneoui.so /target-rootfs/usr/lib/libneoui.so
|
||||
cp -a /bananarchy/prebuilt/sxmo-x11/usr/lib/libtoxcore.so* /target-rootfs/usr/lib/
|
||||
cp -f /bananarchy/prebuilt/sxmo-x11/usr/include/neoui.h /target-rootfs/usr/include/neoui.h
|
||||
cp -a /bananarchy/prebuilt/sxmo-x11/usr/lib/dwm/plugins/. /target-rootfs/usr/lib/dwm/plugins/
|
||||
fi
|
||||
|
||||
@@ -312,12 +312,12 @@ static const char *resolve_plugin_name_from_argv0(const char *argv0) {
|
||||
if (strcasecmp(base, "xtox") == 0 || strcasecmp(base, "tox") == 0) {
|
||||
return "tox";
|
||||
}
|
||||
if (strcasecmp(base, "xkopher") == 0 || strcasecmp(base, "xsmallweb") == 0 ||
|
||||
strcasecmp(base, "smallweb") == 0) {
|
||||
if (strcasecmp(base, "xkopher") == 0 || strcasecmp(base, "kopher") == 0 ||
|
||||
strcasecmp(base, "xsmallweb") == 0 || strcasecmp(base, "smallweb") == 0) {
|
||||
return "smallweb";
|
||||
}
|
||||
if (strcasecmp(base, "xgps") == 0 || strcasecmp(base, "xmaps") == 0 ||
|
||||
strcasecmp(base, "gps") == 0) {
|
||||
strcasecmp(base, "xnav") == 0 || strcasecmp(base, "gps") == 0) {
|
||||
return "gps";
|
||||
}
|
||||
return NULL;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -172,6 +172,9 @@ static const char *ICON_A2X = "\xe2\x87\x84";
|
||||
static const char *ICON_KBD = "\xef\x84\x9c";
|
||||
static const char *ICON_THM = "\xf3\xb0\x8f\x98";
|
||||
static const char *ICON_GAM = "\xf3\xb0\x8a\xb4";
|
||||
static const char *ICON_EML = "\xf3\xb0\x87\xae";
|
||||
static const char *ICON_GLB = "\xef\x82\xac";
|
||||
static const char *ICON_MAP = "\xf3\xb0\x8d\x8d";
|
||||
|
||||
static void drawmenu(void);
|
||||
static void show_menu(void);
|
||||
@@ -2111,6 +2114,18 @@ add_parsed_choice_line(const char *line)
|
||||
return;
|
||||
if (items[i].text && strstr(label, "ReMEdy") && strstr(items[i].text, "ReMEdy"))
|
||||
return;
|
||||
if (items[i].text && strstr(label, "SIP VoIP") && strstr(items[i].text, "SIP VoIP"))
|
||||
return;
|
||||
if (items[i].text && strstr(label, "Email") && strstr(items[i].text, "Email"))
|
||||
return;
|
||||
if (items[i].text && strstr(label, "IRC Chat") && strstr(items[i].text, "IRC Chat"))
|
||||
return;
|
||||
if (items[i].text && strstr(label, "Tox Messenger") && strstr(items[i].text, "Tox Messenger"))
|
||||
return;
|
||||
if (items[i].text && strstr(label, "Kopher") && strstr(items[i].text, "Kopher"))
|
||||
return;
|
||||
if (items[i].text && strstr(label, "GPS & Maps") && strstr(items[i].text, "GPS & Maps"))
|
||||
return;
|
||||
}
|
||||
int loop = (strchr(loop_str, '1') != NULL) ? 1 : 0;
|
||||
if (strncmp(cmd, "sxmo_appmenu.sh ", 16) == 0) {
|
||||
@@ -2398,6 +2413,24 @@ open_builtin_menu(const char *menu_name, int keep_idx)
|
||||
snprintf(label, sizeof(label), "%s Contacts", ICON_USR);
|
||||
add_menu_item(label, "@plugin:contacts", 0);
|
||||
|
||||
snprintf(label, sizeof(label), "%s SIP VoIP", ICON_PHN);
|
||||
add_menu_item(label, "@plugin:sip", 0);
|
||||
|
||||
snprintf(label, sizeof(label), "%s Email", ICON_EML);
|
||||
add_menu_item(label, "@plugin:email", 0);
|
||||
|
||||
snprintf(label, sizeof(label), "%s IRC Chat", ICON_MSG);
|
||||
add_menu_item(label, "@plugin:irc", 0);
|
||||
|
||||
snprintf(label, sizeof(label), "%s Tox Messenger", ICON_MSG);
|
||||
add_menu_item(label, "@plugin:tox", 0);
|
||||
|
||||
snprintf(label, sizeof(label), "%s Kopher (SmallWeb)", ICON_GLB);
|
||||
add_menu_item(label, "@plugin:smallweb", 0);
|
||||
|
||||
snprintf(label, sizeof(label), "%s GPS & Maps", ICON_MAP);
|
||||
add_menu_item(label, "@plugin:gps", 0);
|
||||
|
||||
if (bt_is_unblocked_fast()) {
|
||||
snprintf(label, sizeof(label), "%s Bluetooth", ICON_BTH);
|
||||
add_menu_item(label, "@plugin:networks:bluetooth", 0);
|
||||
@@ -2460,6 +2493,18 @@ open_builtin_menu(const char *menu_name, int keep_idx)
|
||||
snprintf(label, sizeof(label), "%s ReMEdy (J2ME)", ICON_GAM);
|
||||
add_menu_item(label, "remedy", 0);
|
||||
}
|
||||
snprintf(label, sizeof(label), "%s SIP VoIP", ICON_PHN);
|
||||
add_menu_item(label, "@plugin:sip", 0);
|
||||
snprintf(label, sizeof(label), "%s Email", ICON_EML);
|
||||
add_menu_item(label, "@plugin:email", 0);
|
||||
snprintf(label, sizeof(label), "%s IRC Chat", ICON_MSG);
|
||||
add_menu_item(label, "@plugin:irc", 0);
|
||||
snprintf(label, sizeof(label), "%s Tox Messenger", ICON_MSG);
|
||||
add_menu_item(label, "@plugin:tox", 0);
|
||||
snprintf(label, sizeof(label), "%s Kopher (SmallWeb)", ICON_GLB);
|
||||
add_menu_item(label, "@plugin:smallweb", 0);
|
||||
snprintf(label, sizeof(label), "%s GPS & Maps", ICON_MAP);
|
||||
add_menu_item(label, "@plugin:gps", 0);
|
||||
load_cache_or_hook("sxmo_apps.cache", "sxmo_hook_apps.sh");
|
||||
snprintf(label, sizeof(label), "%s Themes", ICON_THM);
|
||||
int has_themes = 0;
|
||||
|
||||
Reference in new issue
Block a user