Golang wrapper for termux:API. This package calls termux:API methods directly so that this package would work without termux-api package installed.
package main
import (
"fmt"
tm "github.com/dolfly/termux/pkg/termux"
)
func main() {
if stat, err := tm.BatteryStatus(); err != nil {
panic(err)
} else {
fmt.Printf("The current battery percentage is %d%%.\n", stat.Percentage)
}
}
package main
import tm "github.com/dolfly/termux/pkg/termux"
func main() {
if err := tm.ClipboardSet("ummmm"); err != nil {
panic(err)
}
}
package main
import (
tm "github.com/dolfly/termux/pkg/termux"
)
func main() {
if err := tm.Toast("Hello World!", tm.ToastOption{
FontColor: "#FF0000",
Position: tm.Top,
Short: true,
BGColor: "#00FF00",
}); err != nil {
panic(err)
}
}