#!/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 'Speed: %s\n' "$textstat" else echo "{\"error\": \"File not found\"}" fi