#!/usr/bin/env bash

sleep 0.2

value=($(cat /sys/class/leds/input*::capslock/brightness | cut -f1 -d,))

# echo ${value[2]}

if [ ${value[2]} == 1 ];
  then
    icon_name="/usr/share/icons/Tela-purple-dark/symbolic/status/capslock-enabled-symbolic.svg"
    output="caps lock on"
  else
    icon_name="/usr/share/icons/Tela-purple-dark/symbolic/status/capslock-disabled-symbolic.svg"
    output="caps lock off"
fi

#notify-send -t 600 -i $icon_name -r 555 $output
# dunstify "$output" -i "$icon_name" -t 600 --replace=555 -h boolean:value:"${value[2]}" -u low
notify-send -e "$output" -i "$icon_name" -h string:x-canonical-private-synchronous:state -h boolean:value:"${value[2]}" -r 555