diff --git a/95-speakersafetyd.rules b/95-speakersafetyd.rules index 0788b49..19e5f7d 100644 --- a/95-speakersafetyd.rules +++ b/95-speakersafetyd.rules @@ -1,25 +1,28 @@ +# Temporary compat rule +SUBSYSTEM=="sound", KERNEL=="card*", ATTR{id}=="J313", ATTR{id}="AppleJ313" + SUBSYSTEM=="sound", DRIVERS=="snd-soc-macaudio", GOTO="speakersafetyd_macaudio" GOTO="speakersafetyd_end" LABEL="speakersafetyd_macaudio" -KERNEL=="pcmC*D2c", ATTRS{id}=="J*", ENV{ACP_IGNORE}="1" +KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ*", ENV{ACP_IGNORE}="1" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J180", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J274", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J293", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -KERNEL=="pcmC*D2c", ATTRS{id}=="J313", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J314", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J316", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J375", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J413", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J414", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J415", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J416", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J456", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J457", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J473", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J474", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J475", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" -#KERNEL=="pcmC*D2c", ATTRS{id}=="J493", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ180", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ274", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ293", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ313", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ314", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ316", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ375", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ413", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ414", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ415", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ416", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ456", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ457", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ473", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ474", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ475", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" +#KERNEL=="pcmC*D2c", ATTRS{id}=="AppleJ493", TAG+="systemd", ENV{SYSTEMD_WANTS}="speakersafetyd.service" LABEL="speakersafetyd_end" diff --git a/src/main.rs b/src/main.rs index 6c99e0d..5890863 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,7 +115,9 @@ fn main() { config_path.set_extension("conf"); info!("Config file: {:?}", config_path); - let device = format!("hw:{}", model.to_ascii_uppercase()); + let maker_titlecase = maker[0..1].to_ascii_uppercase() + &maker[1..]; + + let device = format!("hw:{}{}", maker_titlecase, model.to_ascii_uppercase()); info!("Device: {}", device); let mut cfg: Ini = Ini::new_cs();