Skip to content

Commit

Permalink
small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
zzeneg committed Jan 21, 2024
1 parent 8a53e0a commit 9de776a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ authors = ["zzeneg"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
copy_to_output = "2.1.0"

[dependencies]
tracing = "0.1"
tracing-subscriber = { version="0.3", features = ["env-filter"] }
Expand Down
7 changes: 7 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use copy_to_output::copy_to_output;
use std::env;

fn main() {
println!("cargo:rerun-if-changed=qmk-hid-host.json");
copy_to_output("qmk-hid-host.json", &env::var("PROFILE").unwrap()).expect("Could not copy");
}
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn get_config() -> Config {
usage: 0x61,
usage_page: 0xff60,
},
layouts: vec!["en".to_string(), "ru".to_string()],
layouts: vec!["en".to_string()],
reconnect_delay: 5000,
};

Expand Down
15 changes: 6 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@ mod keyboard;
mod providers;

use config::get_config;
use providers::{layout::LayoutProvider, media::MediaProvider};

use crate::{
keyboard::Keyboard,
providers::{_base::Provider, time::TimeProvider, volume::VolumeProvider},
};
use keyboard::Keyboard;
use providers::{_base::Provider, layout::LayoutProvider, media::MediaProvider, time::TimeProvider, volume::VolumeProvider};

fn main() {
let tracing_subscriber = tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.finish();
let env_filter = tracing_subscriber::EnvFilter::builder()
.with_default_directive(tracing::level_filters::LevelFilter::INFO.into())
.from_env_lossy();
let tracing_subscriber = tracing_subscriber::fmt().with_env_filter(env_filter).finish();
let _ = tracing::subscriber::set_global_default(tracing_subscriber);

let config = get_config();
Expand Down

0 comments on commit 9de776a

Please sign in to comment.