2
2
3
3
A feature-full volume control module for PulseAudio. Also known as Pavolume. Main features:
4
4
5
- * Increase/Decrease and Mute the default sink's audio .
6
- * Switch between sinks easily. You can also blacklist useless devices.
5
+ * Increase/Decrease and Mute the default audio node (can be sink or source) .
6
+ * Switch between nodes easily. You can also blacklist useless devices.
7
7
* Optionally enable notifications and OSD messages.
8
8
* Works as a shortcut to pavucontrol or your favorite audio manager tool.
9
9
* Highly customizable: check the [ Usage] ( #usage ) section for details.
@@ -51,62 +51,74 @@ exec = pulseaudio-control [option...] <action>
51
51
where ` action ` , and (optionally) ` option ` s are as specified in ` pulseaudio-control help ` :
52
52
53
53
```
54
- Usage: pulseaudio-control [OPTION...] ACTION
54
+ Usage: ./pulseaudio-control.bash [OPTION...] ACTION
55
+
56
+ Terminology: A node represents either a sink (output) or source (input).
55
57
56
58
Options:
57
59
--autosync | --no-autosync
58
60
Whether to maintain same volume for all programs.
59
- Default: no
61
+ Default: "no"
60
62
--color-muted <rrggbb>
61
63
Color in which to format when muted.
62
- Default: 6b6b6b
64
+ Default: " 6b6b6b"
63
65
--notifications | --no-notifications
64
- Whether to show notifications when changing sinks .
65
- Default: no
66
+ Whether to show notifications when changing nodes .
67
+ Default: "no"
66
68
--osd | --no-osd
67
69
Whether to display KDE's OSD message.
68
- Default: no
70
+ Default: "no"
69
71
--icon-muted <icon>
70
72
Icon to use when muted.
71
73
Default: none
72
- --icon-sink <icon>
73
- Icon to use for sink .
74
+ --icon-node <icon>
75
+ Icon to use for node .
74
76
Default: none
75
77
--format <string>
76
78
Use a format string to control the output.
79
+ Remember to pass this argument wrapped in single quotes (`'`) instead
80
+ of double quotes (`"`) to avoid your shell from evaluating the
81
+ variables early.
77
82
Available variables:
78
83
* $VOL_ICON
79
84
* $VOL_LEVEL
80
- * $ICON_SINK
81
- * $SINK_NICKNAME
85
+ * $ICON_NODE
86
+ * $NODE_NICKNAME
82
87
* $IS_MUTED (yes/no)
83
- Default: $VOL_ICON ${VOL_LEVEL}% $ICON_SINK $SINK_NICKNAME
88
+ Default: ' $VOL_ICON ${VOL_LEVEL}% $ICON_NODE $NODE_NICKNAME'
84
89
--icons-volume <icon>[,<icon>...]
85
90
Icons for volume, from lower to higher.
86
91
Default: none
92
+ --node-type <node_type>
93
+ Whether to consider PulseAudio sinks (output) or sources (input).
94
+ All the operations of pulseaudio-control will apply to one of the two.
95
+ Pass `input` for the sources, e.g. a microphone.
96
+ Pass `output` for the sinks, e.g. speakers, headphones.
97
+ Default: "output"
87
98
--volume-max <int>
88
99
Maximum volume to which to allow increasing.
89
- Default: 130
100
+ Default: " 130"
90
101
--volume-step <int>
91
102
Step size when inc/decrementing volume.
92
- Default: 2
93
- --sink -blacklist <name>[,<name>...]
94
- Sinks to ignore when switching. You can use globs. Don't forget to
103
+ Default: "2"
104
+ --node -blacklist <name>[,<name>...]
105
+ Nodes to ignore when switching. You can use globs. Don't forget to
95
106
quote the string when using globs, to avoid unwanted shell glob
96
107
extension.
97
108
Default: none
98
- --sink -nicknames-from <prop>
99
- pactl property to use for sink names, unless overriden by
100
- --sink -nickname. Its possible values are listed under the 'Properties'
101
- key in the output of `pactl list sinks`
109
+ --node -nicknames-from <prop>
110
+ pactl property to use for node names, unless overriden by
111
+ --node -nickname. Its possible values are listed under the 'Properties'
112
+ key in the output of `pactl list sinks` and `pactl list sources`.
102
113
Default: none
103
- --sink-nickname <name>:<nick>
104
- Nickname to assign to given sink name, taking priority over
105
- --sink-nicknames-from. May be given multiple times, and 'name' is
106
- exactly as listed in the output of `pactl list sinks short | cut -f2`.
107
- Note that you can also specify a port name for the sink with
114
+ --node-nickname <name>:<nick>
115
+ Nickname to assign to given node name, taking priority over
116
+ --node-nicknames-from. May be given multiple times, and 'name' is
117
+ exactly as listed in the output of `pactl list sinks short | cut -f2`
118
+ and `pactl list sources short | cut -f2`.
119
+ Note that you can also specify a port name for the node with
108
120
`<name>/<port>`.
109
- It is also possible to use glob matching to match sink and port names.
121
+ It is also possible to use glob matching to match node and port names.
110
122
Exact matches are prioritized. Don't forget to quote the string when
111
123
using globs, to avoid unwanted shell glob extension.
112
124
Default: none
@@ -116,12 +128,17 @@ Actions:
116
128
output print the PulseAudio status once
117
129
listen listen for changes in PulseAudio to automatically update
118
130
this script's output
119
- up, down increase or decrease the default sink 's volume
120
- mute, unmute mute or unmute the default sink 's audio
131
+ up, down increase or decrease the default node 's volume
132
+ mute, unmute mute or unmute the default node 's audio
121
133
togmute switch between muted and unmuted
122
- next-sink switch to the next available sink
134
+ next-node switch to the next available node
123
135
sync synchronize all the output streams volume to be the same as
124
- the current sink's volume
136
+ the current node's volume
137
+
138
+ Author:
139
+ Mario Ortiz Manero
140
+ More info on GitHub:
141
+ https://github.com/marioortizmanero/polybar-pulseaudio-control
125
142
```
126
143
127
144
See the [ Module] ( #module ) section for an example, or the [ Useful icons] ( #useful-icons ) section for some packs of icons.
@@ -137,7 +154,7 @@ The example from the screenshot can:
137
154
* Open ` pavucontrol ` on right click
138
155
139
156
``` ini
140
- [module/pulseaudio-control]
157
+ [module/pulseaudio-control-output ]
141
158
type = custom/script
142
159
tail = true
143
160
format-underline = ${colors.cyan}
@@ -147,25 +164,40 @@ label-foreground = ${colors.foreground}
147
164
# Icons mixed from Font Awesome 5 and Material Icons
148
165
# You can copy-paste your options for each possible action, which is more
149
166
# trouble-free but repetitive, or apply only the relevant ones (for example
150
- # --sink -blacklist is only needed for next-sink ).
151
- exec = pulseaudio-control --icons-volume " , " --icon-muted " " --sink -nicknames-from " device.description" --sink -nickname " alsa_output.pci-0000_00_1b.0.analog-stereo: Speakers" --sink -nickname " alsa_output.usb-Kingston_HyperX_Virtual_Surround_Sound_00000000-00.analog-stereo: Headphones" listen
167
+ # --node -blacklist is only needed for next-node ).
168
+ exec = pulseaudio-control --icons-volume " , " --icon-muted " " --node -nicknames-from " device.description" --node -nickname " alsa_output.pci-0000_00_1b.0.analog-stereo: Speakers" --node -nickname " alsa_output.usb-Kingston_HyperX_Virtual_Surround_Sound_00000000-00.analog-stereo: Headphones" listen
152
169
click-right = exec pavucontrol &
153
170
click-left = pulseaudio-control togmute
154
- click-middle = pulseaudio-control --sink -blacklist " alsa_output.pci-0000_01_00.1.hdmi-stereo-extra2" next-sink
171
+ click-middle = pulseaudio-control --node -blacklist " alsa_output.pci-0000_01_00.1.hdmi-stereo-extra2" next-node
155
172
scroll-up = pulseaudio-control --volume-max 130 up
156
173
scroll-down = pulseaudio-control --volume-max 130 down
174
+
175
+ [module/pulseaudio-control-input]
176
+ type = custom/script
177
+ tail = true
178
+ format-underline = ${colors.cyan}
179
+ label-padding = 2
180
+ label-foreground = ${colors.foreground}
181
+
182
+ # Use --node-blacklist to remove the unwanted PulseAudio .monitor that are child of sinks
183
+ exec = pulseaudio-control --node-type input --icons-volume " " --icon-muted " " --node-nickname " alsa_output.pci-0000_0c_00.3.analog-stereo: Webcam" --node-nickname " alsa_output.usb-Kingston_HyperX_Virtual_Surround_Sound_00000000-00.analog-stereo: Headphones" --node-blacklist " *.monitor" listen
184
+ click-right = exec pavucontrol &
185
+ click-left = pulseaudio-control --node-type input togmute
186
+ click-middle = pulseaudio-control --node-type input next-node
187
+ scroll-up = pulseaudio-control --node-type input --volume-max 130 up
188
+ scroll-down = pulseaudio-control --node-type input --volume-max 130 down
157
189
```
158
190
159
191
## Useful icons
160
192
161
- Here's a list with some icons from different fonts you can copy-paste. Most have an space afterwards so that the module has a bit of spacing. They may appear bugged on your browser if the font isn't available there. Please add yours if they aren't in the list.
193
+ Here's a list with some icons from different fonts you can copy-paste. Most have a space afterwards so that the module has a bit of spacing. They may appear bugged on your browser if the font isn't available there. Please add yours if they aren't in the list.
162
194
163
- | Font name | Volumes | Muted | Sink icons |
164
- | ----------------------------------------------- | :-------------: | :-----: | :------------------------: |
165
- | [ FontAwesome] ( https://fontawesome.com ) | ` " , " ` | ` " " ` | ` " " ` or ` " " ` |
166
- | [ Material] ( https://material.io/resources/icons ) | ` " , , " ` | ` " " ` | ` " " ` or ` " " ` or ` " " ` |
167
- | Emoji | ` "🔈 ,🔉 ,🔊 " ` | ` "🔇 " ` | ` "🔈 " ` or ` "🎧 " ` |
168
- | Emoji v2 | ` "🕨 ,🕩 ,🕪 " ` | ` "🔇 " ` | ` "🕨 " ` or ` "🎧 " ` |
195
+ | Font name | Volumes | Muted | Output icons | Input icons |
196
+ | ----------------------------------------------- | :-------------: | :-------------- : | :------------------------: | : ---------: |
197
+ | [ FontAwesome] ( https://fontawesome.com ) | ` " , , " ` | ` " " ` or ` " " ` | ` " " ` or ` " " ` or ` ` | ` ", " ` |
198
+ | [ Material] ( https://material.io/resources/icons ) | ` " , , " ` | ` " " ` or ` " " ` | ` " " ` or ` " " ` or ` " " ` | ` ", " ` |
199
+ | Emoji | ` "🔈 ,🔉 ,🔊 " ` | ` "🔇 " ` | ` "🔈 " ` or ` "🎧 " ` | ` "🎙️ " ` |
200
+ | Emoji v2 | ` "🕨 ,🕩 ,🕪 " ` | ` "🔇 " ` | ` "🕨 " ` or ` "🎧 " ` | ` "🎤 " ` |
169
201
170
202
Most of these can be used after downloading a [ Nerd Font] ( https://www.nerdfonts.com/ ) and including it in your [ Polybar config] ( https://github.com/polybar/polybar/wiki/Fonts ) . For example:
171
203
0 commit comments