From 148525c057f5639ab29b33d52e364d95b0eae6cf Mon Sep 17 00:00:00 2001 From: aminnairi <18418459+aminnairi@users.noreply.github.com> Date: Fri, 14 Apr 2023 23:36:08 +0200 Subject: [PATCH] added a function to decrease the brightness --- fish/functions/decrease_brightness_by.fish | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 fish/functions/decrease_brightness_by.fish diff --git a/fish/functions/decrease_brightness_by.fish b/fish/functions/decrease_brightness_by.fish new file mode 100644 index 0000000..856d905 --- /dev/null +++ b/fish/functions/decrease_brightness_by.fish @@ -0,0 +1,5 @@ +function decrease_brightness_by --argument-names amount + set --local brightness (cat /sys/class/backlight/*/brightness) + set --local brightness_increased (math $brightness - $amount) + echo $brightness_increased | sudo tee /sys/class/backlight/*/brightness > /dev/null +end