#!/bin/bash

operation="${1}"
cache_dir="${HOME}/.cache/sway-profiles"
cache_file="${cache_dir}/kb_brightness"
mkdir -p "${cache_dir}"
#WOBSOCK="$XDG_RUNTIME_DIR/wob.sock"
#source "${HOME}/.config/de-vars/colors/active/colors.sh"
#opacity="BF"

if [[ -z "${kb_brightness}" ]];then
  echo "file doesn't exist"
fi

exit

case "$operation" in
  up)
#    brightnessctl set +5% | sed -En 's/.*\(([0-9]+)%\).*/\1/p'
    brighness_change="+5%"
    ;;&
  down)
#    brightnessctl set 5%- | sed -En 's/.*\(([0-9]+)%\).*/\1/p'
    brighness_change="5%-"
    ;;&
  up|down)
    light_lvl="$(brightnessctl set ${brighness_change} | sed -En 's/.*\(([0-9]+)%\).*/\1/p')"
    echo "${light_lvl}" "${de_color_0}${opacity}" "${de_color_1}${opacity}" "${de_color_3}${opacity}" > "$WOBSOCK"
    ;;
esac
