diff options
| author | Spacedio <spacedio@thernusen.net> | 2026-04-17 22:45:53 -0400 |
|---|---|---|
| committer | Spacedio <spacedio@thernusen.net> | 2026-04-17 22:45:53 -0400 |
| commit | 786dc59d0e6937aa76f5cecc16dec49261c8a625 (patch) | |
| tree | b84590b5abe8b27093af4dce4ba86cf9a1c34f01 /polybar/.config | |
| parent | b9e0b62a52a7c897efa963693b0897c1870ef0e5 (diff) | |
| download | dotfiles-786dc59d0e6937aa76f5cecc16dec49261c8a625.tar.gz | |
Optimization of the dGPU with a script to specifically turn it off.
Diffstat (limited to 'polybar/.config')
| -rw-r--r-- | polybar/.config/polybar/config.ini | 19 | ||||
| -rwxr-xr-x | polybar/.config/polybar/scripts/dgpu-status.sh | 15 |
2 files changed, 34 insertions, 0 deletions
diff --git a/polybar/.config/polybar/config.ini b/polybar/.config/polybar/config.ini index 5c35631..09656ec 100644 --- a/polybar/.config/polybar/config.ini +++ b/polybar/.config/polybar/config.ini @@ -120,6 +120,25 @@ format-prefix-foreground = ${colors.magenta} label = %gb_used% %percentage_used%% label-foreground = ${colors.foreground} +[module/gpu-status] +type = custom/script + +; Path to the helper script we just created +exec = ~/.config/polybar/scripts/dgpu-status.sh + +; Update interval in seconds +interval = 5 + +; Professional styling +format-prefix = "dGPU Status: " +format-padding = 1 +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/wlan] ;inherit = network-base ;interface-type = wireless diff --git a/polybar/.config/polybar/scripts/dgpu-status.sh b/polybar/.config/polybar/scripts/dgpu-status.sh new file mode 100755 index 0000000..257c744 --- /dev/null +++ b/polybar/.config/polybar/scripts/dgpu-status.sh @@ -0,0 +1,15 @@ +#!/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 +else + echo "OFF" # GPU powered down and removed +fi |
