29 lines
454 B
Bash
Executable file
29 lines
454 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
|
|
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>"
|