summaryrefslogtreecommitdiff
path: root/sb-gpu
blob: 8e27da1b28b6c7a5435e0b8bc2b830f2815bb623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

getGPUClock() {
	echo "$GPUClock" | sed -n "s/[0-9]: //g;/*/ {s/\s.*//; p}" /sys/class/drm/card1/device/pp_dpm_sclk
}
getGPUBusy() {
	echo "$GPUBusy" | cat /sys/class/drm/card1/device/gpu_busy_percent
}
getGPUTemperature() {
	echo "$GPUTemp" | sed "s/000//" /sys/class/drm/card1/device/hwmon/hwmon1/temp1_input
}

case $BLOCK_BUTTON in
	#1) notify-send "RadeonTop" "$(radeontop)" ;;
	2) setsid -f "$TERMINAL" -e radeontop ;;
	3) notify-send "GPU Module" "\- Shows graphics core utilization.
- Middle Click to show RadeonTop." ;;
	6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

printf "%s %s%% 🌡️%s°\n" "$(getGPUClock)" "$(getGPUBusy)" "$(getGPUTemperature)"