aboutsummaryrefslogtreecommitdiffstats
path: root/polybar/.config
diff options
context:
space:
mode:
Diffstat (limited to 'polybar/.config')
-rw-r--r--polybar/.config/polybar/modules.ini17
-rwxr-xr-xpolybar/.config/polybar/scripts/dgpu-status.sh14
2 files changed, 9 insertions, 22 deletions
diff --git a/polybar/.config/polybar/modules.ini b/polybar/.config/polybar/modules.ini
index d82a909..e8952d1 100644
--- a/polybar/.config/polybar/modules.ini
+++ b/polybar/.config/polybar/modules.ini
@@ -84,19 +84,14 @@ label-muted-foreground = ${colors.disabled}
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
[module/gpu-status]
-type = custom/script
-exec = ~/.config/polybar/scripts/dgpu-status.sh
-interval = 5
+type = custom/ipc
+hook-0 = ~/.config/polybar/scripts/dgpu-status.sh
+initial = 1
-format-prefix = "dGPU Status: "
-format-padding = 1
+format-prefix = "󱕷"
format-background = ${colors.background-alt}
format-foreground = ${colors.primary}
-; Optional: Left-click to open a terminal and toggle
-; click-left = st -e sudo gpu-switch on
-; click-right = st -e sudo gpu-switch off
-
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
[module/battery]
@@ -113,7 +108,7 @@ format-discharging = <ramp-capacity><label-discharging>
label-charging = %percentage%%
label-discharging =%percentage%%
label-full = Full
-label-low = LOW
+label-low = LOW
ramp-capacity-0 = " "
ramp-capacity-1 = " "
@@ -139,7 +134,7 @@ animation-discharging-4 = " "
animation-discharging-framerate = 500
animation-low-0 = !
-animation-low-1 =
+animation-low-1 =
animation-low-framerate = 200
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
diff --git a/polybar/.config/polybar/scripts/dgpu-status.sh b/polybar/.config/polybar/scripts/dgpu-status.sh
index 257c744..6a51656 100755
--- a/polybar/.config/polybar/scripts/dgpu-status.sh
+++ b/polybar/.config/polybar/scripts/dgpu-status.sh
@@ -1,15 +1,7 @@
#!/bin/bash
-# Path to the dGPU on the PCI bus
-PCI_PATH="/sys/bus/pci/devices/0000:57:00.0"
-
-if [ -d "$PCI_PATH" ]; then
- # Optional: Check if the driver is actually loaded
- if lsmod | grep -q "nvidia"; then
- echo "ON" # Icon for NVIDIA/GPU Active
- else
- echo "STBY" # Hardware present but driver unloaded
- fi
+if /usr/local/bin/gpu-toggle status; then
+ echo " ON"
else
- echo "OFF" # GPU powered down and removed
+ echo " OFF"
fi