Toggles the LED torch (flashlight) on the device.

Usage #

package main

import (
    t "github.com/hugmouse/gotermux"
)

func main() {
    // Turn on the torch
    t.TermuxTorch(true)
    
    // Turn off the torch
    t.TermuxTorch(false)
}

Parameters #

  • on bool - Set to true to enable torch, false to disable
The function will log “Turning on the LED torch” or “Turning off the LED torch” to indicate the action being performed.