Update keybindings module
- New keybindings - Tests
This commit is contained in:
parent
ba65888457
commit
4d0692dd72
@ -4,7 +4,7 @@ use penrose::{
|
||||
actions::{exit, modify_with, send_layout_message, spawn},
|
||||
layout::messages::{ExpandMain, IncMain, ShrinkMain},
|
||||
},
|
||||
core::bindings::KeyEventHandler,
|
||||
core::bindings::{KeyEventHandler,parse_keybindings_with_xmodmap},
|
||||
map,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
@ -28,8 +28,12 @@ pub fn raw_key_bindings() -> HashMap<String, Box<dyn KeyEventHandler<RustConn>>>
|
||||
"M-S-Down" => send_layout_message(|| IncMain(-1)),
|
||||
"M-S-Right" => send_layout_message(|| ExpandMain),
|
||||
"M-S-Left" => send_layout_message(|| ShrinkMain),
|
||||
"M-semicolon" => spawn("dmenu_run"),
|
||||
"M-Return" => spawn("st"),
|
||||
"M-a" => spawn("rofi -show drun"),
|
||||
"M-Return" => spawn("alacritty"),
|
||||
"C-A-p" => spawn("firefox --private-window"),
|
||||
"C-A-c" => spawn("codium"),
|
||||
"C-A-k" => spawn("keepassxc"),
|
||||
"C-A-f" => spawn("nautilus"),
|
||||
"M-A-Escape" => exit(),
|
||||
};
|
||||
|
||||
@ -45,3 +49,17 @@ pub fn raw_key_bindings() -> HashMap<String, Box<dyn KeyEventHandler<RustConn>>>
|
||||
|
||||
raw
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn bindings_parse_correctly_with_xmodmap() {
|
||||
let res = parse_keybindings_with_xmodmap(raw_key_bindings());
|
||||
|
||||
if let Err(e) = res {
|
||||
panic!("{e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user