mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-12-02 12:18:41 -05:00
27 lines
900 B
Plaintext
27 lines
900 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
if [ -z "$WAYLAND_DISPLAY" ]; then
|
||
|
notification=dunst
|
||
|
else
|
||
|
notification=mako
|
||
|
fi
|
||
|
|
||
|
case $1 in
|
||
|
up)
|
||
|
if command -v light >/dev/null
|
||
|
then
|
||
|
light -A 5 > /dev/null && notify-send -i ~/.config/${notification}/idea.png "Brightness: $(light -G | cut -d '.' -f 1)%"
|
||
|
else
|
||
|
brightnessctl set 5%+ >/dev/null && notify-send -i ~/.config/${notification}/idea.png "Brightness: $(brightnessctl i | grep '%' | awk -F'(' '{print $2}' | awk -F'%' '{print $1}')%"
|
||
|
fi ;;
|
||
|
down)
|
||
|
if command -v light >/dev/null
|
||
|
then
|
||
|
light -U 5 > /dev/null && notify-send -i ~/.config/${notification}/idea.png "Brightness: $(light -G | cut -d '.' -f 1)%"
|
||
|
else
|
||
|
brightnessctl set 5%- >/dev/null && notify-send -i ~/.config/${notification}/idea.png "Brightness: $(brightnessctl i | grep '%' | awk -F'(' '{print $2}' | awk -F'%' '{print $1}')%"
|
||
|
fi ;;
|
||
|
*)
|
||
|
;;
|
||
|
esac
|