-
-
Save pyaf/31e375584cb8cd3322fe0c3029914d07 to your computer and use it in GitHub Desktop.
Bash script for GPU usage and utilization monitoring in i3status bar.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
output=$(nvidia-smi --format=csv,noheader --query-gpu=name,power.draw,fan.speed,utilization.gpu,temperature.gpu,memory.used,memory.total) | |
IFS=',' read -r -a array <<< "$output" | |
name=${array[0]} | |
power=${array[1]} | |
fan=${array[2]} | |
util=${array[3]} | |
temp=${array[4]} | |
used=${array[5]} | |
total=${array[6]} | |
echo "$name:$used /$total,$util,$temp°C" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment