pkgs: add change-backlight

This commit is contained in:
Bruno BELANYI 2021-11-04 15:55:33 +01:00
parent 7dc177cf44
commit f6381b14b0
3 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$1" = "up" ]; then
upDown="+$2%"
else
upDown="$2%-"
fi
newBrightness="$(brightnessctl -m set "$upDown" | cut -d, -f4)"
notify-send -u low \
-h string:x-canonical-private-synchronous:change-backlight \
-h "int:value:${newBrightness/\%/}" \
-- "Set brightness to $newBrightness"