nix-setup/bright.script.nix

14 lines
260 B
Nix
Raw Normal View History

2024-09-07 01:18:31 +02:00
with import <nixpkgs> {};
pkgs.writeShellScriptBin "bright" ''
#!/bin/sh
f="/sys/class/backlight/*/brightness"
if [ "$1" = up ] ; then
echo $(($(cat $f) + 50)) | sudo tee $f
fi
if [ "$1" = down ] ; then
echo $(($(cat $f) - 50)) | sudo tee $f
fi
''