update
This commit is contained in:
parent
16fb08ae03
commit
ae9d2aec9b
4 changed files with 33 additions and 15 deletions
|
@ -15,3 +15,4 @@ thiserror = "1.0.26"
|
|||
paste = "1.0.5"
|
||||
serde_json = "1.0.64"
|
||||
simplelog = "0.8.0"
|
||||
|
||||
|
|
10
Makefile
10
Makefile
|
@ -1,9 +1,13 @@
|
|||
ohio2-penrose:
|
||||
violet:
|
||||
cargo build --release
|
||||
install-root:
|
||||
cp -f target/release/violet /usr/local/bin/violet
|
||||
cp -f scripts/init.sh /usr/local/bin/violet-init.sh
|
||||
install:
|
||||
scp target/debug/ohio2-penrose /usr/bin/ohio2-penrose
|
||||
cp -f target/release/violet ~/.local/bin/violet
|
||||
cp -f scripts/init.sh ~/.local/bin/init.sh
|
||||
remove:
|
||||
rm /usr/bin/ohio2-penrose
|
||||
rm /usr/local/bin/violet
|
||||
clean:
|
||||
rm Cargo.lock
|
||||
rm -rf target
|
||||
|
|
3
scripts/init.sh
Executable file
3
scripts/init.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env zsh
|
||||
picom &
|
||||
nitrogen &
|
28
src/main.rs
28
src/main.rs
|
@ -1,39 +1,50 @@
|
|||
#[macro_use]
|
||||
extern crate penrose;
|
||||
|
||||
use penrose::{
|
||||
contrib::{
|
||||
actions::focus_or_spawn,
|
||||
extensions::{dmenu::*, Scratchpad},
|
||||
},
|
||||
core::{
|
||||
bindings::KeyEventHandler,
|
||||
config::Config,
|
||||
helpers::index_selectors,
|
||||
manager::WindowManager,
|
||||
layout::{
|
||||
LayoutConf,
|
||||
Layout,
|
||||
side_stack,
|
||||
monocle,
|
||||
}
|
||||
},
|
||||
logging_error_handler,
|
||||
xcb::new_xcb_backed_window_manager,
|
||||
Backward, Forward, Less, More, Selector
|
||||
};
|
||||
|
||||
use simplelog::{LevelFilter, SimpleLogger};
|
||||
|
||||
|
||||
// Replace these with your preferred terminal and program launcher
|
||||
const TERMINAL: &str = "alacritty";
|
||||
const LAUNCHER: &str = "dmenu_run";
|
||||
|
||||
const BROWSER: &str = "brave";
|
||||
|
||||
fn main() -> penrose::Result<()> {
|
||||
//let hooks: Hooks<Conn> = vec![
|
||||
// ManageExistingClients::new(),
|
||||
// sp.get_hook(),
|
||||
// Box::new(StartupScript::new("/usr/local/scripts/penrose-startup.sh")),
|
||||
//];
|
||||
// Initialise the logger (use LevelFilter::Debug to enable debug logging)
|
||||
if let Err(e) = SimpleLogger::init(LevelFilter::Info, simplelog::Config::default()) {
|
||||
panic!("unable to set log level: {}", e);
|
||||
};
|
||||
|
||||
let config = Config::default();
|
||||
let key_bindings = gen_keybindings! {
|
||||
// Program launchers
|
||||
"M-semicolon" => run_external!(LAUNCHER);
|
||||
"M-A-Return" => run_external!(LAUNCHER);
|
||||
"M-Return" => run_external!(TERMINAL);
|
||||
"A-b" => run_external!(BROWSER);
|
||||
|
||||
// Exit Penrose (important to remember this one!)
|
||||
// Exit Violet (important to remember this one!)
|
||||
"M-A-C-Escape" => run_internal!(exit);
|
||||
|
||||
// client management
|
||||
|
@ -56,7 +67,6 @@ fn main() -> penrose::Result<()> {
|
|||
"M-A-Down" => run_internal!(update_max_main, Less);
|
||||
"M-A-Right" => run_internal!(update_main_ratio, More);
|
||||
"M-A-Left" => run_internal!(update_main_ratio, Less);
|
||||
|
||||
refmap [ config.ws_range() ] in {
|
||||
"M-{}" => focus_workspace [ index_selectors(config.workspaces().len()) ];
|
||||
"M-S-{}" => client_to_workspace [ index_selectors(config.workspaces().len()) ];
|
||||
|
|
Loading…
Reference in a new issue