#!/bin/sh _notify_brightness() { if command -v mako >/dev/null then icon="$HOME/.config/mako/idea.png" else icon="$HOME/.config/dunst/idea.png" fi notify-send -h string:x-canonical-private-synchronous:brightness "Brightness: $1%" -h int:value:"$1" -i "${icon}" } case $1 in up) if command -v light >/dev/null then light -A 5 >/dev/null brightness="$(light -G | cut -d '.' -f 1)" _notify_brightness "$brightness" else brightnessctl set 5%+ >/dev/null brightness="$(brightnessctl i | grep '%' | awk -F'(' '{print $2}' | awk -F'%' '{print $1}')" _notify_brightness "$brightness" fi ;; down) if command -v light >/dev/null then light -U 5 >/dev/null brightness="$(light -G | cut -d '.' -f 1)" _notify_brightness "$brightness" else brightnessctl set 5%- >/dev/null brightness="$(brightnessctl i | grep '%' | awk -F'(' '{print $2}' | awk -F'%' '{print $1}')" _notify_brightness "$brightness" fi ;; *) ;; esac