mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-29 02:38:37 -05:00
27 lines
900 B
Bash
Executable File
27 lines
900 B
Bash
Executable File
#!/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
|