Sets the display brightness of the device.
Usage #
package main
import (
t "github.com/hugmouse/gotermux"
)
func main() {
// Set brightness to 50% (128 out of 255)
result := t.TermuxBrightness(128)
// Set brightness to maximum
t.TermuxBrightness(255)
// Set brightness to minimum
t.TermuxBrightness(0)
}
Parameters #
val uint8
- Brightness value from 0 (minimum) to 255 (maximum)
Return Value #
Returns []byte
containing the command output.
Note: This may not work if automatic brightness control is enabled on the device.
Termux API reference #
termux-brightness