aboutsummaryrefslogtreecommitdiff
path: root/waybar/custom_modules/custom-gpu.sh
diff options
context:
space:
mode:
authorBlaster4385 <[email protected]>2025-08-15 15:09:35 +0530
committerBlaster4385 <[email protected]>2025-08-15 15:09:35 +0530
commit5690fffa9360180dcf79738cde27b918e09e6273 (patch)
treeb999d0a1f875791652bcec1a80ad8d575ad55d9a /waybar/custom_modules/custom-gpu.sh
parentaddbb7a93bf327b3f4f445805722039df457c145 (diff)
feat: added waybar and kitty configsHEADmain
Diffstat (limited to 'waybar/custom_modules/custom-gpu.sh')
-rwxr-xr-xwaybar/custom_modules/custom-gpu.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/waybar/custom_modules/custom-gpu.sh b/waybar/custom_modules/custom-gpu.sh
new file mode 100755
index 0000000..e87374d
--- /dev/null
+++ b/waybar/custom_modules/custom-gpu.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+raw_clock=$(cat /sys/class/drm/card0/device/pp_dpm_sclk | egrep -o '[0-9]{0,4}Mhz \W' | sed "s/Mhz \*//")
+clock=$(echo "scale=1;$raw_clock/1000" | bc | sed -e 's/^-\./-0./' -e 's/^\./0./')
+
+raw_temp=$(cat /sys/class/drm/card0/device/hwmon/hwmon5/temp1_input)
+temperature=$(($raw_temp/1000))
+busypercent=$(cat /sys/class/hwmon/hwmon5/device/gpu_busy_percent)
+deviceinfo=$(glxinfo -B | grep 'Device:' | sed 's/^.*: //')
+driverinfo=$(glxinfo -B | grep "OpenGL version")
+
+echo '{"text": "'$clock'GHz |  '$temperature'°C <span color=\"darkgray\">| '$busypercent'%</span>", "class": "custom-gpu", "tooltip": "<b>'$deviceinfo'</b>\n'$driverinfo'"}' \ No newline at end of file