Add startup script

- And `cargo fmt` clean-up
This commit is contained in:
Candifloss 2025-11-17 20:00:33 +05:30
parent 4d0692dd72
commit 9455982687
2 changed files with 16 additions and 7 deletions

View File

@ -1,11 +1,11 @@
use penrose::x11rb::RustConn;
use penrose::{
builtin::{
actions::{exit, modify_with, send_layout_message, spawn},
layout::messages::{ExpandMain, IncMain, ShrinkMain},
},
core::bindings::{KeyEventHandler,parse_keybindings_with_xmodmap},
core::bindings::KeyEventHandler,
map,
x11rb::RustConn,
};
use std::collections::HashMap;

View File

@ -1,14 +1,23 @@
use penrose::x11rb::RustConn;
use penrose::{
Result,
core::bindings::parse_keybindings_with_xmodmap,
core::{Config, WindowManager},
core::{Config, WindowManager, bindings::parse_keybindings_with_xmodmap},
extensions::hooks::{add_ewmh_hooks, startup::SpawnOnStartup},
x11rb::RustConn,
};
use tracing_subscriber::{self, prelude::*};
const STARTUP_SCRIPT: &str = "/home/candifloss/Works/penrose-wm/test/penrose-startup.sh";
mod keybindings;
mod mousebindings;
fn config() -> Config<RustConn> {
Config {
startup_hook: Some(SpawnOnStartup::boxed(STARTUP_SCRIPT)),
..Config::default()
}
}
fn main() -> Result<()> {
tracing_subscriber::fmt()
.with_env_filter("info")
@ -19,7 +28,7 @@ fn main() -> Result<()> {
let key_bindings = parse_keybindings_with_xmodmap(keybindings::raw_key_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()
}