Compare commits
No commits in common. "f2cb1defa00d6dd432958557afaede0663542c85" and "2f325db17060da96e0ecc420754f90c6ab5537b0" have entirely different histories.
f2cb1defa0
...
2f325db170
3 changed files with 10 additions and 26 deletions
|
@ -1,5 +1,5 @@
|
||||||
use int_enum::IntEnum;
|
use int_enum::IntEnum;
|
||||||
use log::error;
|
use log::{error, info, warn};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::process;
|
use std::process;
|
||||||
|
@ -100,6 +100,9 @@ pub enum KeyMapVariant {
|
||||||
PipeWire {
|
PipeWire {
|
||||||
ids: Vec<String>,
|
ids: Vec<String>,
|
||||||
},
|
},
|
||||||
|
Key {
|
||||||
|
keycode: u8, //TODO: add real keycodes
|
||||||
|
},
|
||||||
Exec {
|
Exec {
|
||||||
command: String,
|
command: String,
|
||||||
args: Option<Vec<String>>,
|
args: Option<Vec<String>>,
|
||||||
|
|
|
@ -4,7 +4,6 @@ use crate::midi_client::KeyEvent;
|
||||||
use crate::mpris_client;
|
use crate::mpris_client;
|
||||||
use crossbeam_channel::Receiver;
|
use crossbeam_channel::Receiver;
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
use std::process::{Command, Output};
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -92,20 +91,8 @@ fn eval(key: NanoKeys, state: u8, config: &Arc<Config>) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
KeyMapVariant::PipeWire { ids } => {}
|
KeyMapVariant::PipeWire { ids } => {}
|
||||||
KeyMapVariant::Exec { command, args } => {
|
KeyMapVariant::Key { keycode } => {}
|
||||||
let output: Result<Output, std::io::Error> = match args {
|
KeyMapVariant::Exec { command, 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use log::warn;
|
|
||||||
use mpris::Player;
|
use mpris::Player;
|
||||||
use mpris::PlayerFinder;
|
use mpris::PlayerFinder;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
@ -37,15 +36,10 @@ where
|
||||||
{
|
{
|
||||||
let player = PlayerFinder::new()
|
let player = PlayerFinder::new()
|
||||||
.expect("Could not connect to D-Bus")
|
.expect("Could not connect to D-Bus")
|
||||||
.find_active();
|
.find_active()
|
||||||
match player {
|
.expect("Could not find any player");
|
||||||
Ok(p) => {
|
|
||||||
function(&p);
|
function(&player);
|
||||||
}
|
|
||||||
Err(err) => {
|
|
||||||
warn!("Could not find an active player: {err}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn exec_functionality<F>(player_id: Option<&str>, exec_closure: F)
|
fn exec_functionality<F>(player_id: Option<&str>, exec_closure: F)
|
||||||
|
|
Loading…
Reference in a new issue