Reorganize Fedora dotfiles and remove legacy profile
This commit is contained in:
11
fedora/quickshell/scripts/gpu.sh
Normal file
11
fedora/quickshell/scripts/gpu.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
data=$(nvidia-smi --query-gpu=utilization.gpu,temperature.gpu --format=csv,noheader,nounits 2>/dev/null)
|
||||
if [ -z "$data" ]; then
|
||||
printf '%s\n' '{"text":"N/A"}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
usage=$(printf '%s\n' "$data" | cut -d',' -f1 | tr -d ' ')
|
||||
temp=$(printf '%s\n' "$data" | cut -d',' -f2 | tr -d ' ')
|
||||
printf '{"text":"%s%% %sC"}\n' "$usage" "$temp"
|
||||
Reference in New Issue
Block a user