diff options
Diffstat (limited to 'des/i3/i3blocks/scripts/fan')
| -rwxr-xr-x | des/i3/i3blocks/scripts/fan | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/des/i3/i3blocks/scripts/fan b/des/i3/i3blocks/scripts/fan new file mode 100755 index 0000000..84f1725 --- /dev/null +++ b/des/i3/i3blocks/scripts/fan @@ -0,0 +1,10 @@ +#!/usr/bin/bash + +FAN_DIR=/sys/devices/platform/applesmc.768 +MAX_FAN=$(cat $FAN_DIR/fan1_max) +CURR_FAN=$(cat $FAN_DIR/fan1_output) + +ICON_FAN="" +FAN_P=$(echo - | awk -v max="$MAX_FAN" -v curr="$CURR_FAN" '{printf "%1.0f\n", (curr / max)*100}') + +echo "$ICON_FAN $FAN_P%" |
