xbrightness: migrate to by-name

This commit is contained in:
Primrose 2025-05-20 17:14:38 +02:00
parent e8d40e36ed
commit a67f69e126
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 0 additions and 1 deletions

View file

@ -0,0 +1,14 @@
{
writeShellApplication,
bc,
}:
writeShellApplication {
name = "xbrightness";
runtimeInputs = [bc];
text = ''
device=$1
rel=$2
brightness=$(xrandr --verbose | grep Brightness | cut -d':' -f 2)
xrandr --output "$device" --brightness "$(echo "$brightness $rel" | bc -l)"
'';
}