
Add commands that can be the target of keybindings to perform an action and update the status bar.
14 lines
380 B
Bash
Executable File
14 lines
380 B
Bash
Executable File
#!/bin/bash
|
|
|
|
read -r -d '' bl_dir < \
|
|
<(find /sys/class/backlight -mindepth 1 -maxdepth 1 -print0 | head -z -n 1)
|
|
read -r max_bl < "${bl_dir}"/max_brightness
|
|
delta=$((max_bl / 10))
|
|
bl_file="${bl_dir}"/brightness
|
|
read -r bl < "${bl_file}"
|
|
bl2=$((bl - delta))
|
|
if [[ "${bl2}" -lt 0 ]]; then bl2=0; fi
|
|
printf '%s' "${bl2}" | sudo tee "${bl_file}" &> /dev/null
|
|
"${0%/*}"/../avds bl
|
|
|