dotfiles/.i3blocks/rgb
2021-08-12 20:26:12 +02:00

29 lines
474 B
Bash
Executable file

#!/bin/bash
runtime="${XDG_RUNTIME_DIR}/i3blocks"
[[ ! -d "$runtime" ]] && mkdir -p "$runtime"
if [[ -n "$button" ]]
then
if [[ -f "$runtime/rgb" ]]
then
sudo msi-rgb 0 0 0 &>/dev/null
rm "$runtime/rgb"
else
sudo msi-rgb FFFFFFFF 0 0 &>/dev/null
touch "$runtime/rgb"
fi
else
sudo msi-rgb FFFFFFFF 0 0 &>/dev/null
touch $runtime/rgb
fi
if [[ -f "$runtime/rgb" ]]
then
color="#99CC99"
else
color="#747369"
fi
echo "<span foreground=\"$color\">rgb</span>"