alsacontrol: Allow to pass hw: instead of cardid

This commit is contained in:
nemunaire 2024-11-21 17:51:16 +01:00
parent d9a0551937
commit bb2f432a4b

View File

@ -114,7 +114,12 @@ type CardControlState struct {
}
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()
if err != nil {