1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-13 01:20:24 +02:00

created the amixer parser docu

This commit is contained in:
Eden Refael
2024-11-29 11:57:57 +02:00
parent 896660017c
commit 1876e2dfd8

View File

@ -1,3 +1,59 @@
r"""jc - JSON Convert `amixer sget` command output parser
Usage (cli):
$ amixer sget <control_name> | jc --amixer
$ amixer sget Master | jc --amixer
$ amixer sget Capture | jc --amixer
$ amixer sget Speakers | jc --amixer
Usage (module):
import jc
result = jc.parse('amixer', <amixer sget command output>)
Schema:
{
"control_name": string,
"capabilities": [
string
],
"playback_channels": [
string
],
"limits": {
"playback_min": string,
"playback_max": string
},
"mono": {
"playback_value": string,
"percentage": string,
"dB": string,
"status": string
}
}
Examples:
$ amixer sget Master | jc --amixer -p
{
"control_name": "Master",
"capabilities": [
"pvolume",
"pvolume-joined",
"pswitch",
"pswitch-joined"
],
"playback_channels": [
"Mono"
],
"limits": {
"playback_min": "0",
"playback_max": "87"
},
"mono": {
"playback_value": "87",
"percentage": "100%",
"dB": "0.00dB",
"status": "on"
}
}
"""
from typing import List, Dict
import jc.utils