#!/usr/bin/fish xbacklight $argv[1..-1] set brightness (cat /sys/class/backlight/intel_backlight/brightness) set bar (seq -s "─" 0 (math $brightness / 36) | tr -d '[:digit:]') set percentage (printf '%44s%d%%' '' (math $brightness / 12)) set body "$percentage\n $bar" set title ' Brightness' set file /tmp/notify-brightness.id set age (find "$file" -cmin -0.025) if [ -n "$age" ] dunstify -r (cat "$file") -t 1500 "$title" "$body" touch "$file" else set id (dunstify -p -t 1500 "$title" "$body") echo $id > "$file" chmod 600 "$file" end