carbon: script control external monitor control

This commit is contained in:
Primrose 2024-08-06 14:45:22 +02:00
parent 11a5b54398
commit f759789fcc
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
6 changed files with 36 additions and 8 deletions

View file

@ -0,0 +1,16 @@
{
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)"
'';
}