diff --git a/src/controller.rs b/src/controller.rs index 6399733..fee658a 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -4,6 +4,7 @@ use crate::midi_client::KeyEvent; use crate::mpris_client; use crossbeam_channel::Receiver; use log::{error, info, warn}; +use std::process::{Command, Output}; use std::sync::Arc; use std::thread; @@ -92,7 +93,20 @@ fn eval(key: NanoKeys, state: u8, config: &Arc) { }, KeyMapVariant::PipeWire { ids } => {} KeyMapVariant::Key { keycode } => {} - KeyMapVariant::Exec { command, args } => {} + KeyMapVariant::Exec { command, args } => { + let output: Result = match args { + Some(some_args) => Command::new(command).args(some_args).output(), + None => Command::new(command).output(), + }; + match output { + Ok(out) => { + info!("{:?}", out); + } + Err(err) => { + error!("{:?}", err); + } + } + } } } }