Skip to content

Commit

Permalink
working on config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Walker-00 committed Aug 4, 2023
1 parent b40d24f commit 754ab30
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ lto = true
codegen-units = 1

[dependencies]
confy = "0.5.1"
directories = "5.0.1"
penrose = "0.3.3"
simplelog = "0.12.1"
serde = { version = "1.0.181", features = ["derive"] }
serde_json = "1.0.104"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
11 changes: 10 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use directories::BaseDirs;
use penrose::{
builtin::{
actions::{exit, modify_with, send_layout_message, spawn},
Expand All @@ -11,9 +12,15 @@ use penrose::{
x11rb::RustConn,
Result,
};
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, fs::File};
use tracing_subscriber::{self, prelude::*};

#[derive(Serialize, Deserialize, Debug)]
struct WMConfig {
bindings: HashMap<String, String>,
}

fn raw_key_bindings() -> HashMap<String, Box<dyn KeyEventHandler<RustConn>>> {
let mut raw_bindings = map! {
map_keys: |k: &str| k.to_string();
Expand All @@ -37,6 +44,8 @@ fn raw_key_bindings() -> HashMap<String, Box<dyn KeyEventHandler<RustConn>>> {
"M-A-Escape" => exit(),
};

let config_dir = BaseDirs::new().unwrap().config_dir();

for tag in &["1", "2", "3", "4", "5", "6", "7", "8", "9"] {
raw_bindings.extend([
(
Expand Down

0 comments on commit 754ab30

Please sign in to comment.