GoTermux is a wrapper library around the termux-api.
It allows you to call termux-*
scripts and read the their output in a convenient way.
package main
import (
"fmt"
t "github.com/hugmouse/gotermux"
)
func main() {
battery := t.TermuxBatteryStatus()
fmt.Println(battery.Percentage) // This will print "38.0"
}
You can find a quickstart guide here: https://hugmouse.github.io/gotermux-docs/0.1/overview/
Termux API reference: https://hugmouse.github.io/gotermux-docs/0.1/termux-api/
GoTermux reference: https://hugmouse.github.io/gotermux-docs/0.1/gotermux
API documentation can also be found on pkg.go.dev: https://pkg.go.dev/github.com/hugmouse/gotermux