add gpuinfo window and top window

This commit is contained in:
Leon Kowarschick 2020-05-14 00:50:42 +02:00
parent 262179e1a6
commit 99cfc82a43
6 changed files with 19 additions and 4 deletions

View file

@ -1,4 +1,4 @@
{ {
"optOut": false, "optOut": false,
"lastUpdateCheck": 1589203310918 "lastUpdateCheck": 1589407237422
} }

View file

@ -136,8 +136,9 @@ label-mounted = %percentage_used%%
[module/cpu] [module/cpu]
type = internal/cpu type = internal/cpu
interval = 2 interval = 2
format-prefix = "%{F#fe8019}%{F-} " format-prefix = "%{A1:~/.config/polybar/polybar-scripts/toggle_gpuinfo_window.sh 'top':}%{F#fe8019}%{F-} %{A}"
label = %percentage:2%% label = %percentage:2%%
click-left = ""
[module/memory] [module/memory]
type = internal/memory type = internal/memory
@ -203,6 +204,7 @@ interval = 600
type = custom/script type = custom/script
exec = "sudo ~/scripts/gpuinfo.sh" exec = "sudo ~/scripts/gpuinfo.sh"
format = "%{F#d3869b}%{T3}%{T-}%{F-} <label>" format = "%{F#d3869b}%{T3}%{T-}%{F-} <label>"
click-left = "~/.config/polybar/polybar-scripts/toggle_gpuinfo_window.sh 'sudo /home/leon/scripts/gpuinfo.sh --watch'"
interval = 2 interval = 2
[module/pulseaudio-control] [module/pulseaudio-control]

View file

@ -0,0 +1,7 @@
#!/bin/bash
if [[ -n $(xdotool search --class bar_system_status_indicator) ]]; then
xdotool search --class bar_system_status_indicator windowkill &
else
termite --class bar_system_status_indicator -e "$1" &
fi

View file

@ -378,6 +378,7 @@ myManageHook = composeAll
, className =? "mpv" --> ManageHelpers.doRectFloat (W.RationalRect 0.9 0.9 0.1 0.1) , className =? "mpv" --> ManageHelpers.doRectFloat (W.RationalRect 0.9 0.9 0.1 0.1)
, title =? "Something" --> doFloat , title =? "Something" --> doFloat
, className =? "termite_floating" --> ManageHelpers.doRectFloat(W.RationalRect 0.2 0.2 0.6 0.6) , className =? "termite_floating" --> ManageHelpers.doRectFloat(W.RationalRect 0.2 0.2 0.6 0.6)
, className =? "bar_system_status_indicator" --> ManageHelpers.doRectFloat (W.RationalRect 0.7 0.05 0.29 0.26)
-- , isFullscreen --> doF W.focusDown <+> doFullFloat -- , isFullscreen --> doF W.focusDown <+> doFullFloat
, manageDocks , manageDocks
, namedScratchpadManageHook scratchpads , namedScratchpadManageHook scratchpads

View file

@ -1,5 +1,10 @@
#!/bin/dash #!/bin/dash
#sudo cat /sys/kernel/debug/dri/0/amdgpu_pm_info #sudo cat /sys/kernel/debug/dri/0/amdgpu_pm_info
if [ "$1" = "--watch" ]; then
sudo watch --no-title -n 0.5 "cat /sys/kernel/debug/dri/0/amdgpu_pm_info | grep -A 10 'GFX Clocks and Power'"
else
sudo cat /sys/kernel/debug/dri/0/amdgpu_pm_info \ sudo cat /sys/kernel/debug/dri/0/amdgpu_pm_info \
| sed -n 's/^GPU Load: \(.*\)$/\1/gp' | sed -n 's/^GPU Load: \(.*\)$/\1/gp'
fi