add nvidia smi to polybar

This commit is contained in:
Ben Kyd
2023-05-23 21:11:16 +01:00
parent 050224c177
commit 05b1a8da26
3 changed files with 15 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ border-bottom-color = ${colors.background}
modules-left = i3 empty-space title
modules-center = time
modules-right = empty-space spotify empty-space backlight empty-space audio empty-space cpu empty-space temperature empty-space memory empty-space battery empty-space arrow
modules-right = empty-space spotify empty-space backlight empty-space audio empty-space gpu cpu empty-space temperature empty-space memory empty-space battery empty-space arrow
cursor-click = pointer
cursor-scroll = ns-resize

View File

@@ -107,6 +107,19 @@ format-foreground = ${colors.sapphire}
# =======================================
[module/gpu]
type = custom/script
exec = $HOME/.config/polybar/scripts/gpu.sh
interval = 0.5
tail = true
format = <label>
label = "%output%% "
format-prefix = " "
format-prefix-foreground = ${colors.green}
format-foreground = ${colors.green}
# =======================================
[module/temperature]
type = custom/script
exec = sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '[0-9]*.[0-9]*°C' -o

View File

@@ -0,0 +1 @@
nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | awk '{printf "%02d\n", $1}'