Add startup script
- And `cargo fmt` clean-up
This commit is contained in:
parent
4d0692dd72
commit
9455982687
@ -1,11 +1,11 @@
|
|||||||
use penrose::x11rb::RustConn;
|
|
||||||
use penrose::{
|
use penrose::{
|
||||||
builtin::{
|
builtin::{
|
||||||
actions::{exit, modify_with, send_layout_message, spawn},
|
actions::{exit, modify_with, send_layout_message, spawn},
|
||||||
layout::messages::{ExpandMain, IncMain, ShrinkMain},
|
layout::messages::{ExpandMain, IncMain, ShrinkMain},
|
||||||
},
|
},
|
||||||
core::bindings::{KeyEventHandler,parse_keybindings_with_xmodmap},
|
core::bindings::KeyEventHandler,
|
||||||
map,
|
map,
|
||||||
|
x11rb::RustConn,
|
||||||
};
|
};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
@ -62,4 +62,4 @@ mod tests {
|
|||||||
panic!("{e}");
|
panic!("{e}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
17
src/main.rs
17
src/main.rs
@ -1,14 +1,23 @@
|
|||||||
use penrose::x11rb::RustConn;
|
|
||||||
use penrose::{
|
use penrose::{
|
||||||
Result,
|
Result,
|
||||||
core::bindings::parse_keybindings_with_xmodmap,
|
core::{Config, WindowManager, bindings::parse_keybindings_with_xmodmap},
|
||||||
core::{Config, WindowManager},
|
extensions::hooks::{add_ewmh_hooks, startup::SpawnOnStartup},
|
||||||
|
x11rb::RustConn,
|
||||||
};
|
};
|
||||||
use tracing_subscriber::{self, prelude::*};
|
use tracing_subscriber::{self, prelude::*};
|
||||||
|
|
||||||
|
const STARTUP_SCRIPT: &str = "/home/candifloss/Works/penrose-wm/test/penrose-startup.sh";
|
||||||
|
|
||||||
mod keybindings;
|
mod keybindings;
|
||||||
mod mousebindings;
|
mod mousebindings;
|
||||||
|
|
||||||
|
fn config() -> Config<RustConn> {
|
||||||
|
Config {
|
||||||
|
startup_hook: Some(SpawnOnStartup::boxed(STARTUP_SCRIPT)),
|
||||||
|
..Config::default()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
tracing_subscriber::fmt()
|
tracing_subscriber::fmt()
|
||||||
.with_env_filter("info")
|
.with_env_filter("info")
|
||||||
@ -19,7 +28,7 @@ fn main() -> Result<()> {
|
|||||||
let key_bindings = parse_keybindings_with_xmodmap(keybindings::raw_key_bindings())?;
|
let key_bindings = parse_keybindings_with_xmodmap(keybindings::raw_key_bindings())?;
|
||||||
let mouse_bindings = mousebindings::mouse_bindings();
|
let mouse_bindings = mousebindings::mouse_bindings();
|
||||||
|
|
||||||
let wm = WindowManager::new(Config::default(), key_bindings, mouse_bindings, conn)?;
|
let wm = WindowManager::new(add_ewmh_hooks(config()), key_bindings, mouse_bindings, conn)?;
|
||||||
|
|
||||||
wm.run()
|
wm.run()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user