diff options
| author | Spacedio <spacedio@thernusen.net> | 2026-06-03 22:39:11 -0400 |
|---|---|---|
| committer | Spacedio <spacedio@thernusen.net> | 2026-06-03 22:39:11 -0400 |
| commit | 7846c1b33585a88333d2b0ac2270d0d304a2eeac (patch) | |
| tree | 27839140aef97d0fd24b8bd405df1583edca86af /polybar | |
| parent | c9631b31a16b18140b7e471193618f5618fd0521 (diff) | |
| download | dotfiles-7846c1b33585a88333d2b0ac2270d0d304a2eeac.tar.gz | |
Continuing work on the Polybar dGPU module. Switched from Pulseaudio to Pipewire.
Diffstat (limited to 'polybar')
| -rw-r--r-- | polybar/.config/polybar/modules.ini | 17 | ||||
| -rwxr-xr-x | polybar/.config/polybar/scripts/dgpu-status.sh | 14 |
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 |
