Files
dotfiles/i3/scripts/gpu_usage.sh
T

13 lines
333 B
Bash
Executable File

#!/bin/bash
# ~/.config/i3/scripts/gpu_usage.sh
if command -v rocm-smi &>/dev/null; then
output=$(rocm-smi --showtemp --showuse)
temp=$(echo "$output" | awk -F': ' '/Sensor edge/ {print $3; exit}')
usage=$(echo "$output" | awk -F': ' '/GPU use/ {print $3; exit}')
echo "${usage}% ${temp}°C"
else
echo "N/A"
fi