dotfiles/.i3blocks/rgb

30 lines
454 B
Text
Raw Normal View History

2021-01-15 21:59:21 +01:00
#!/bin/bash
runtime="${XDG_RUNTIME_DIR}/i3blocks"
[[ ! -d "$runtime" ]] && mkdir -p "$runtime"
if [[ -n "$button" ]]
then
if [[ -f "$runtime/rgb" ]]
then
openrgb -d 0 -m direct -c 000000 &>/dev/null
rm "$runtime/rgb"
else
openrgb -d 0 -m 'Color Cycle' &>/dev/null
touch "$runtime/rgb"
fi
else
touch $runtime/rgb
fi
if [[ -f "$runtime/rgb" ]]
then
color="#99CC99"
else
color="#747369"
fi
echo "<span foreground=\"$color\">rgb</span>"