From 00c1309ed18d4a91052f839b51e0877198de3914 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Wed, 31 Oct 2018 14:04:38 -0400 Subject: [PATCH] avoid 0% brightness --- files/.local/bin/brightness-control | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/files/.local/bin/brightness-control b/files/.local/bin/brightness-control index 98d9c99..8f83f66 100755 --- a/files/.local/bin/brightness-control +++ b/files/.local/bin/brightness-control @@ -29,8 +29,13 @@ case $1 in send_notification ;; down) - # decrease the backlight by 5% - brightnessctl set 5%- + if [[ $(get_brightness) -lt 5 ]]; then + # avoid 0% brightness + brightnessctl set 1% + else + # decrease the backlight by 5% + brightnessctl set 5%- + fi send_notification ;; esac