Added code to fix strange behaviour from brightness keys
This commit is contained in:
parent
022b52cdc6
commit
cf33bf9d93
@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# You can call this script like this:
|
# You can call this script like this:
|
||||||
# $./dunst-backlight.sh up
|
# $./dunst-backlight.sh up
|
||||||
# $./dunst-backlight.sh down
|
# $./dunst-backlight.sh down
|
||||||
@ -22,12 +20,16 @@ send_notification() {
|
|||||||
case $1 in
|
case $1 in
|
||||||
up)
|
up)
|
||||||
# Increase backlight
|
# Increase backlight
|
||||||
xbacklight -inc 10%
|
xbacklight -inc 10% > /dev/null
|
||||||
|
backlight=$(xbacklight -get | cut -f1 -d"." | cut -f1 -d"0")
|
||||||
|
xbacklight -set "${backlight}0"
|
||||||
send_notification
|
send_notification
|
||||||
;;
|
;;
|
||||||
down)
|
down)
|
||||||
# Decrease backlight
|
# Decrease backlight
|
||||||
xbacklight -dec 10%
|
xbacklight -dec 10% > /dev/null
|
||||||
|
backlight=$(xbacklight -get | cut -f1 -d"." | cut -f1 -d"0")
|
||||||
|
xbacklight -set "${backlight}0"
|
||||||
send_notification
|
send_notification
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user