fresh init
This commit is contained in:
1 parent
f208f22443
commit
30c3ff48a5
10 files changed
+1333
No files matched your search
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
icon_dir="$HOME/.config/bspwm/assets/icons"
|
||||
steps=5
|
||||
|
||||
send_notification () {
|
||||
brightness=$(brightnessctl i | grep -oP '\(\K[^%\)]+')
|
||||
|
||||
if [ $brightness -lt "15" ]; then
|
||||
icon="$icon_dir/brightness-1.svg"
|
||||
elif [ $brightness -lt "30" ]; then
|
||||
icon="$icon_dir/brightness-2.svg"
|
||||
elif [ $brightness -lt "45" ]; then
|
||||
icon="$icon_dir/brightness-3.svg"
|
||||
elif [ $brightness -lt "60" ]; then
|
||||
icon="$icon_dir/brightness-4.svg"
|
||||
elif [ $brightness -lt "75" ]; then
|
||||
icon="$icon_dir/brightness-5.svg"
|
||||
elif [ $brightness -lt "90" ]; then
|
||||
icon="$icon_dir/brightness-6.svg"
|
||||
else
|
||||
icon="$icon_dir/brightness-7.svg"
|
||||
fi
|
||||
|
||||
notify-send -a Brightness -i $icon -t 2000 -r 969696 "Brightness : $brightness"
|
||||
}
|
||||
|
||||
docs () {
|
||||
echo "
|
||||
Usage: brightness [Options]
|
||||
|
||||
Options:
|
||||
up - Increase the brightness
|
||||
down - Decrease the brightness
|
||||
"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
up)
|
||||
brightnessctl set "${steps:-5}%+" -q
|
||||
send_notification
|
||||
;;
|
||||
down)
|
||||
brightnessctl set "${steps:-5}%-" -q
|
||||
send_notification
|
||||
;;
|
||||
*)
|
||||
docs
|
||||
;;
|
||||
esac
|
||||
Reference in new issue
Block a user