-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbr
More file actions
35 lines (33 loc) · 1.39 KB
/
br
File metadata and controls
35 lines (33 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# [20250606] `br` - Brightness set of Termux API
# https://github.com/MasterInQuestion/ShellUtils/blob/main/br
# Alt name: `brr`; if somehow conflicts Brotli.
[ -z "${1//[0-9]}" ] && {
# ^ https://pubs.opengroup.org/onlinepubs/9799919799/utilities/test.html
# [ $1 -le 255 ] || set -- 255; # [1]
# https://github.com/termux/termux-api-package/blob/master/scripts/termux-brightness.in
exec '/data/data/com.termux/files/usr/libexec/termux-api-broadcast' 'Brightness' \
--ei brightness "${1:-"17"}" \
--ez auto false; # ^ Substitute "17" with other desirable, if desired.
# Note "termux-api-broadcast" is "termux-api" symlink resolved.
};
cat "$0";
#
# "${var:-"subst"}"
# https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_06_02
#
# "${var//patn}"
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
#
# Basic Regular Expressions
# https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap09.html#tag_09_03
# https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_14
# https://www.gnu.org/software/bash/manual/bash.html#Filename-Expansion
#
# Further discussion:
# https://github.com/termux/termux-api/discussions/778
#
# [ [1]
# The exact interpretation of the input value is implementation dependent.
# Expected integer range 0 .. 255.
# Passing certain outrageous values may cause irrevocable hardware damage. ]
#