Files
dotfiles/.local/bin/fanstat
T
2024-05-21 00:40:31 +05:30

13 lines
374 B
Bash
Executable File

#!/bin/bash
# Check if the file exists
if [ -f ~/.local/bin/fanctl ]; then
# Read the values of text, class, and tooltip
source ~/.local/bin/stats/fanstat
# Output the values in JSON format using printf
printf '{"text": "%s", "tooltip": "%s", "class": "%s"}\n' "$textstat" "$tooltipstat" "$classstat"
else
echo "{\"error\": \"File not found\"}"
fi