alsacontrol: Allow to pass hw: instead of cardid
This commit is contained in:
parent
d9a0551937
commit
bb2f432a4b
@ -114,7 +114,12 @@ type CardControlState struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ParseAmixerContent(cardId string) ([]*CardControl, error) {
|
func ParseAmixerContent(cardId string) ([]*CardControl, error) {
|
||||||
cmd := exec.Command("amixer", "-c", cardId, "-M", "contents")
|
cardIdType := "-D"
|
||||||
|
if _, err := strconv.Atoi(cardId); err == nil {
|
||||||
|
cardIdType = "-c"
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd := exec.Command("amixer", cardIdType, cardId, "-M", "contents")
|
||||||
|
|
||||||
stdout, err := cmd.StdoutPipe()
|
stdout, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user