https://github.com/marcdonald/polybar-mic-volume
Polybar module for displaying microphone volume
https://github.com/marcdonald/polybar-mic-volume
Last synced: 11 months ago
JSON representation
Polybar module for displaying microphone volume
- Host: GitHub
- URL: https://github.com/marcdonald/polybar-mic-volume
- Owner: MarcDonald
- License: mit
- Created: 2020-09-30T13:54:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-17T20:00:17.000Z (about 3 years ago)
- Last Synced: 2024-12-12T08:39:26.090Z (over 1 year ago)
- Language: Shell
- Homepage:
- Size: 9.77 KB
- Stars: 32
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# polybar-mic-volume
> **Note**
> I don't use Linux anymore so I don't actively maintain this project, but feel
> free to make a PR for any fixes that are needed!
Polybar module that displays the volume of a given input device using PulseAudio
`pacmd` and controls it using `pactl`.

## Usage
To use this module, put the following module in your Polybar config,
substituting `MICROPHONE_NAME` with the name or index of the device you want to
display, and substituting `PATH_TO_SCRIPT` with the path to the `mic-volume.sh`
script.
If you don't include `MICROPHONE_NAME` the default input device will be used
instead.
```
[module/mic-volume]
type = custom/script
interval = 1
format = Mic:
exec = bash PATH_TO_SCRIPT show-vol MICROPHONE_NAME
; Control actions (using pactl)
click-left = bash PATH_TO_SCRIPT mute-vol MICROPHONE_NAME
scroll-up = bash PATH_TO_SCRIPT inc-vol MICROPHONE_NAME
scroll-down = bash PATH_TO_SCRIPT dec-vol MICROPHONE_NAME
```
For example:
```
[module/mic-volume]
type = custom/script
interval = 1
format = Mic:
exec = bash ~/.config/polybar/mic-volume/mic-volume.sh show-vol 'alsa_input.usb-Samson_Technologies_Samson_Meteor_Mic-00.analog-stereo'
; Control actions (using pactl)
; Example supplying the name of the source
click-left = bash ~/.config/polybar/mic-volume/mic-volume.sh mute-vol 'alsa_input.usb-Samson_Technologies_Samson_Meteor_Mic-00.analog-stereo'
; Example supplying the index of the source
scroll-up = bash ~/.config/polybar/mic-volume/mic-volume.sh inc-vol 2
; Example leaving the MICROPHONE_NAME blank and using the default source
scroll-down = bash ~/.config/polybar/mic-volume/mic-volume.sh dec-vol
```
> **Note**
> The name and index of the source can be found by running `pacmd list-sources`. Ignore
> the arrow brackets when using the name.