The script is designed to track your current location and estimate the distance to a specified geographical point. Once you reach the target location, it alerts you with vibration and/or a sound signal.
The script utilizes the termux-api package to retrieve GPS coordinates, control device volume (during an alarm), and enable vibration. Additionally, it requires the sox package to generate a beep sound and jq for JSON parsing.
To install the script, execute:
git clone https://github.com/BuriXon-code/Termux-GPS-tracker
cd Termux-GPS-tracker
chmod +x trackerThe script requires specific parameters:
-
-lt | --latitude <value>
(Required) Latitude of the target location, e.g.,-10.123 -
-lg | --longitude <value>
(Required) Longitude of the target location, e.g.,50.765 -
-r | --radius <value>
(Required) Radius in meters to trigger the alert -
-d | --delay <value>
(Optional, default: 15) Delay in seconds between GPS checks -
-p | --provider <gps|network|passive>
(Optional, default: gps) The location provider method -
-v | --volume <value>
(Optional, default: 40) Alarm volume level (range: 1-150) -
-s | --save <path-to-file>
(Optional) Saves location tracking data to a KML file.
Caution
If the file already exists, it will be overwritten.
Warning
The script opens the KML file upon startup, appends new waypoints after each measurement, and closes the KML document only when the script is stopped with CTRL+C. Stopping the script in any other way will result in file corruption.
Tip
The saved KML file can be used in Google Earth or similar applications to visualize the traveled route.
tracker -lt 12.34567 -lg 76.54321 -r 100 -d 60 -p network -v 100 -s /sdcard/route.kmlOr using an environment variable:
export LOCATION="-lt 12.34567 -lg 76.54321"
tracker $(echo $LOCATION) -r 100 -d 60 -p network -v 100 -s /sdcard/route.kmlFor proper functionality, ensure the following packages are installed in Termux:
- Termux:API with
termux-apipackage - bash
- sox (for sound alerts)
- jq (for JSON parsing)
For any issues, suggestions, or questions, reach out via:
- Email: support@burixon.dev
- Contact form: Click here
- Bug reports: Click here
If you find this script useful, consider supporting my work by making a donation:
Your contributions help in developing new projects and improving existing tools!
Enjoy tracking with Termux-GPS-tracker! 🌍🛵