- Some code are written by ChatGPT
- This way is not a general way for reading sensor data on every devices, you may need to adapt it for your device
- The compass is not calibrated, so it may have some offsets
- Use at your own risk
- I used Samsung Galaxy watch 7, ONEUI 8.0
- I used a fork of termux-monet (achyuki/termux-monet)
- Remember to download armeabi instead of aarch64 version
- Grant full permissions to termux-monet app
- Use
adb shell appops set com.termux MANGE_EXTERNAL_STORAGE allowto allow termux-monet to read external storage, or it will crash on launch - Enable built-in termux-api
- Disable monet background
- Change termux font, I used MiSans
- Open drawer, if you cannot, edit termux keys and add a
DRAWERkey - Long press
keyboardto disable it - To do these steps, I used scrcpy
# level
termux-sensor -c;clear;termux-sensor -d 100 -s "Your Rotation Vector sensor name"|stdbuf -o0 jq -r '."Your Rotation Vector sensor name".values[0:4] | @sh '|./gmt level
# compass
termux-sensor -c;clear;termux-sensor -d 100 -s "Your Rotation Vector sensor name"|stdbuf -o0 jq -r '."Your Rotation Vector sensor name".values[0:4] | @sh '|./gmt compass
# Shake to change
termux-sensor -c;clear;termux-sensor -d 100 -s "Your Rotation Vector sensor name","Your Gyroscope sensor name"|stdbuf -o0 jq -r '."Your Rotation Vector sensor name".values[0:4], ."Your Gyroscope sensor name".values[0:3] | @sh '|./gmt
The sensor name can be found by running termux-sensor -l.
For Samsung Galaxy Watch 7, the sensor name is "GeoMag Rotation Vector Sensor", and for my xiaomi 15 phone, it's "rotation vector Non-wakeup". So you need to find the correct sensor name for your device.