kellyjonbrazil / jc

CLI tool and python library that converts the output of popular command-line tools, file-types, and common strings to JSON, YAML, or Dictionaries. This allows piping of output to tools like jq and simplifying automation scripts.
MIT License
7.79k stars 198 forks source link

amixer command output parser #591

Open AvocadoStyle opened 5 days ago

AvocadoStyle commented 5 days ago

What

As part of utilizing the Advanced Linux Sound Architecture (ALSA), there is a need to develop a parser for the amixer tool. This parser will process and interpret the output of the amixer command to analyze audio settings and states.

Why

The amixer command provides detailed information about sound settings and controls on a Linux system. By creating an output parser, you can automate the analysis and handling of this data, enabling you to:

For Which Commands output we'll create the parser

We'll run the amixer Command.

  1. Run the Command sget:

    amixer sget <control_name>

    The output for Example:

    $ amixer sget Master
    Simple mixer control 'Master',0
      Capabilities: pvolume pvolume-joined pswitch pswitch-joined
      Playback channels: Mono
      Limits: Playback 0 - 87
      Mono: Playback 87 [100%] [0.00dB] [on]
    
  2. And more commands such as amixer list-sources and amixer scontent and amixer scontrols...
kellyjonbrazil commented 5 days ago

Thank you for the parser suggestion! Looks like this could be a good parser for jc. I'll need more output samples to develop the parser and tests since I have not used this command before. Thanks!

AvocadoStyle commented 5 days ago

@kellyjonbrazil Hey Kelly! I’d love to take on developing the amixer parser if that works for you. It’s a great way for me to dive into this open-source project and contribute. Plus, working on this will help me build skills for creating more advanced parsers and improving the projects infrastructure in the future.

kellyjonbrazil commented 5 days ago

Absolutely! I welcome a PR. Please take a look at https://github.com/kellyjonbrazil/jc/blob/master/CONTRIBUTING.md