summaryrefslogtreecommitdiff
path: root/src/config.rs
blob: 0fc7144444ca544c9197b20fe4ab99c4202c3751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! User configuration
#![allow(clippy::unreadable_literal)] // Colours are more readable this way imo

use xcb::x::ModMask;
use xkeysym::Keysym;

use crate::{
    bind,
    conn_info::Colour,
    helpers::{focus_next, focus_prev, spawn},
    keys::{Keybind, Keybinds},
};

/// Width of the border around windows
pub const BORDER_WIDTH: u16 = 3;

/// Default border for windows
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(&[
    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} },
]);