#Parsing wpctl output

1 messages ยท Page 1 of 1 (latest)

cursive berry
#

Hello ๐Ÿ‘‹ I'm trying to inspect the output of wpctl status in order to find out IDs and switch between them. The use case is cycling between my headset and a secondary Bluetooth device

However the box characters found in the output make the usual paragraph awk commands not very effective
With a few irrelevant part cut out, off that output:

PipeWire 'pipewire-0' [0.3.75, angrybacon@maestro, cookie:4815162342]
 โ””โ”€ Clients:
        ...

Audio
 โ”œโ”€ Devices:
 โ”‚      38. Navi 21/23 HDMI/DP Audio Controller [alsa]
 โ”‚      39. Built-in Audio                      [alsa]
 โ”‚      79. My Bluetooth Headset                [bluez5]
 โ”‚      79. Secondary Bluetooth Device          [bluez5]
 โ”‚  
 โ”œโ”€ Sinks:
 โ”‚      40. Navi 21/23 HDMI/DP Audio Controller Digital Stereo (HDMI 2) [vol: 0.45]
 โ”‚      41. Built-in Audio Digital Stereo (IEC958) [vol: 0.50]
 โ”‚  *   78. Bluetooth Headset                   [vol: 0.55]
 โ”‚      92. Secondary Bluetooth Device          [vol: 0.31]
 โ”‚  
 โ”‚  ... 
 โ”‚  
 โ””โ”€ Streams:
        ...
        ...

Video
 โ”œโ”€ Devices:
 โ”‚  ...
 โ””โ”€ Streams:

This is the part that I'm looking for:

 โ”‚      40. Navi 21/23 HDMI/DP Audio Controller Digital Stereo (HDMI 2) [vol: 0.45]
 โ”‚      41. Built-in Audio Digital Stereo (IEC958) [vol: 0.50]
 โ”‚  *   78. Bluetooth Headset                   [vol: 0.55]
 โ”‚      92. Secondary Bluetooth Device          [vol: 0.31]

Although only 78 and 92 are relevant and I'm not sure it's possible to differentiate physical devices only but I can focus on that issue later

hollow viper
#

wpctl status | grep vol ?

#

or grep "vol:" to be safe

cursive berry
#

I'm not sure what video devices are supposed to look like but looking at volume might not do it