init
This commit is contained in:
27
misc/bin/brightness
Normal file
27
misc/bin/brightness
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
# Originally created by - https://github.com/rxyhn
|
||||
|
||||
DIR="$HOME/.local/share/assets"
|
||||
BRIGHTNESS_STEPS=5
|
||||
|
||||
function get_brightness {
|
||||
brightnessctl i | grep -oP '\(\K[^%\)]+'
|
||||
}
|
||||
|
||||
function send_notification {
|
||||
icon="$DIR/brightness.svg"
|
||||
brightness=$(get_brightness)
|
||||
bar=$(seq -s "─" 0 $((brightness / 5)) | sed 's/[0-9]//g')
|
||||
dunstify "Brightness $brightness%" -i $icon -r 5555 -u normal -h int:value:$(($brightness))
|
||||
}
|
||||
|
||||
case $1 in
|
||||
up)
|
||||
brightnessctl set "${BRIGHTNESS_STEPS:-5}%+" -q
|
||||
send_notification
|
||||
;;
|
||||
down)
|
||||
brightnessctl set "${BRIGHTNESS_STEPS:-5}%-" -q
|
||||
send_notification
|
||||
;;
|
||||
esac
|
Reference in New Issue
Block a user