polybar: add pipewire buffer size module
This commit is contained in:
@ -32,7 +32,7 @@ font-0 = mononoki-12;1
|
|||||||
|
|
||||||
modules-left = ewmh
|
modules-left = ewmh
|
||||||
modules-center = date
|
modules-center = date
|
||||||
modules-right = mpd filesystem pulseaudio xkeyboard memory cpu wlan eth
|
modules-right = mpd filesystem pipewire_buffer_size pulseaudio xkeyboard memory cpu wlan eth
|
||||||
|
|
||||||
cursor-click = pointer
|
cursor-click = pointer
|
||||||
cursor-scroll = ns-resize
|
cursor-scroll = ns-resize
|
||||||
@ -43,10 +43,16 @@ enable-ipc = true
|
|||||||
|
|
||||||
; wm-restack = generic
|
; wm-restack = generic
|
||||||
; wm-restack = bspwm
|
; wm-restack = bspwm
|
||||||
; wm-restack = i3
|
wm-restack = i3
|
||||||
|
|
||||||
; override-redirect = true
|
; override-redirect = true
|
||||||
|
|
||||||
|
[module/pipewire_buffer_size]
|
||||||
|
type = custom/script
|
||||||
|
exec = ~/.config/polybar/pipewire_buffer_size.sh
|
||||||
|
interval = 10
|
||||||
|
click-right = ~/.config/polybar/pipewire_buffer_size.sh click
|
||||||
|
|
||||||
[module/info-hlwm-workspaces]
|
[module/info-hlwm-workspaces]
|
||||||
type = custom/script
|
type = custom/script
|
||||||
exec = ~/.config/polybar/info-hlwm-workspaces/info-hlwm-workspaces.sh
|
exec = ~/.config/polybar/info-hlwm-workspaces/info-hlwm-workspaces.sh
|
||||||
|
|||||||
18
.config/polybar/pipewire_buffer_size.sh
Executable file
18
.config/polybar/pipewire_buffer_size.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
BUFFER_SIZES=("64" "128" "256" "512" "1024" "2048" "4096")
|
||||||
|
|
||||||
|
current_buffer_size=$(pw-metadata -n settings 0 clock.force-quantum | grep -oP "value:'\K[0-9]+")
|
||||||
|
|
||||||
|
if [[ $1 == "click" ]]; then
|
||||||
|
new_buffer_size=$(echo "${BUFFER_SIZES[@]}" | tr ' ' '\n' | xmenu)
|
||||||
|
|
||||||
|
if [[ -n $new_buffer_size ]]; then
|
||||||
|
pw-metadata -n settings 0 clock.force-quantum "$new_buffer_size"
|
||||||
|
current_buffer_size=$new_buffer_size
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$current_buffer_size"
|
||||||
Reference in New Issue
Block a user