diff options
author | tcmal <me@aria.rip> | 2024-06-26 21:52:09 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-06-26 21:52:09 +0100 |
commit | adcf670ba60c4489b14d4b9dd03a0f7799cf8fb7 (patch) | |
tree | f99dbd4a0d3504278ed16f7cd5753f2a5402675c /src/config.rs | |
parent | 6785d154460921cc3b774376a676a226402d8270 (diff) |
start adding some more keybinds
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 54 |
1 files changed, 44 insertions, 10 deletions
diff --git a/src/config.rs b/src/config.rs index 246fe12..3c2b309 100644 --- a/src/config.rs +++ b/src/config.rs @@ -7,7 +7,9 @@ use xcb::x::ModMask; use xkeysym::Keysym; use crate::{ + bind, conn_info::Colour, + helpers::*, keys::{Keybind, Keybinds}, }; @@ -20,14 +22,46 @@ pub const BORDER_NORMAL: Colour = Colour::from_hex(0x000000); /// Border around currently focused window pub const BORDER_FOCUSED: Colour = Colour::from_hex(0xff0000); +/// The main modifier used for keybinds. +pub const MAIN_MODIFIER: ModMask = ModMask::CONTROL; + +/// Command for application menu / launcher. +pub const MENU_COMMAND: &str = "dmenu_run"; + /// The keybinds to use. -pub const KEYBINDS: Keybinds = Keybinds(&[Keybind { - modifiers: ModMask::CONTROL, - key: Keysym::t, - action: &|_| { - // TODO: disown this process, probably using another way to spawn commands - if let Err(e) = Command::new("xterm").spawn() { - dbg!(e); - } - }, -}]); +pub const KEYBINDS: Keybinds = Keybinds(&[ + bind!(MAIN_MODIFIER , Return -> &|_| spawn::<_, &str>("xterm", [])), + bind!(MAIN_MODIFIER , p -> &|_| spawn::<_, &str>(MENU_COMMAND, [])), + bind!(MAIN_MODIFIER , j -> &focus_next), + bind!(MAIN_MODIFIER , k -> &focus_prev), + // { MODKEY, XK_j, focusstack, {.i = +1 } }, + // { MODKEY, XK_k, focusstack, {.i = -1 } }, + // { MODKEY, XK_i, incnmaster, {.i = +1 } }, + // { MODKEY, XK_d, incnmaster, {.i = -1 } }, + // { MODKEY, XK_h, setmfact, {.f = -0.05} }, + // { MODKEY, XK_l, setmfact, {.f = +0.05} }, + // { MODKEY, XK_Return, zoom, {0} }, + // { MODKEY, XK_Tab, view, {0} }, + // { MODKEY|ShiftMask, XK_c, killclient, {0} }, + // { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, + // { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, + // { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, + // { MODKEY, XK_space, setlayout, {0} }, + // { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, + // { MODKEY, XK_0, view, {.ui = ~0 } }, + // { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, + // { MODKEY, XK_comma, focusmon, {.i = -1 } }, + // { MODKEY, XK_period, focusmon, {.i = +1 } }, + // { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, + // { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, + // TAGKEYS( XK_1, 0) + // TAGKEYS( XK_2, 1) + // TAGKEYS( XK_3, 2) + // TAGKEYS( XK_4, 3) + // TAGKEYS( XK_5, 4) + // TAGKEYS( XK_6, 5) + // TAGKEYS( XK_7, 6) + // TAGKEYS( XK_8, 7) + // TAGKEYS( XK_9, 8) + // { MODKEY|ShiftMask, XK_q, quit, {0} }, +]); |