Improve default config
now includes media control keys
This commit is contained in:
parent
fdb5774594
commit
1819dabbc4
1 changed files with 31 additions and 19 deletions
|
@ -16,30 +16,42 @@ pub fn init(path: PathBuf) -> Config {
|
|||
}
|
||||
|
||||
fn serialize_default() -> Result<String, Error> {
|
||||
let mut mpris = BTreeMap::new();
|
||||
let mut keymap = BTreeMap::new();
|
||||
keymap.insert(
|
||||
NanoKeys::Param4Mute,
|
||||
vec![
|
||||
KeyMapVariant::Mpris {
|
||||
ids: Option::Some(vec!["Feishin".to_string()]),
|
||||
action: MprisAction::PlayPause,
|
||||
},
|
||||
KeyMapVariant::PipeWire {
|
||||
ids: vec![
|
||||
"alsa_output.usb-0d8c_Generic_USB_Audio_Device-00.iec958-stereo".to_string(),
|
||||
],
|
||||
},
|
||||
],
|
||||
);
|
||||
keymap.insert(
|
||||
NanoKeys::Play,
|
||||
vec![KeyMapVariant::Exec {
|
||||
command: "echo hello".to_string(),
|
||||
args: Option::None,
|
||||
vec![KeyMapVariant::Mpris {
|
||||
ids: Option::None,
|
||||
action: MprisAction::PlayPause,
|
||||
}],
|
||||
);
|
||||
keymap.insert(
|
||||
NanoKeys::Stop,
|
||||
vec![KeyMapVariant::Mpris {
|
||||
ids: Option::None,
|
||||
action: MprisAction::Stop,
|
||||
}],
|
||||
);
|
||||
keymap.insert(
|
||||
NanoKeys::Next,
|
||||
vec![KeyMapVariant::Mpris {
|
||||
ids: Option::None,
|
||||
action: MprisAction::Next,
|
||||
}],
|
||||
);
|
||||
keymap.insert(
|
||||
NanoKeys::Prev,
|
||||
vec![KeyMapVariant::Mpris {
|
||||
ids: Option::None,
|
||||
action: MprisAction::Previous,
|
||||
}],
|
||||
);
|
||||
keymap.insert(
|
||||
NanoKeys::Param1Slider,
|
||||
vec![KeyMapVariant::Mpris {
|
||||
ids: Option::Some(vec!["Feishin".to_string()]),
|
||||
action: MprisAction::Volume,
|
||||
}],
|
||||
);
|
||||
mpris.insert("music".to_string(), "Feishin".to_string());
|
||||
let conf: Config = Config {
|
||||
general: General {
|
||||
midi_device: "nanoKONTROL2".to_string(),
|
||||
|
|
Loading…
Reference in a new issue