tony / oxwm

Branch: 7572793
Switch branches/tags
master
tonybanters updating padding ff60f36 2025-10-03
108 lines · 4.1 KB Raw Blame History
1 use crate::keyboard::handlers::Key;
2 use crate::keyboard::{Arg, KeyAction, keycodes};
3 use x11rb::protocol::xproto::KeyButMask;
4
5 // ========================================
6 // APPEARANCE
7 // ========================================
8 pub const BORDER_WIDTH: u32 = 1;
9 pub const BORDER_FOCUSED: u32 = 0x6dade3;
10 pub const BORDER_UNFOCUSED: u32 = 0xbbbbbb;
11 pub const BAR_HEIGHT: u16 = 32;
12 pub const FONT: &str = "JetBrainsMono Nerd Font:size=12";
13
14 // ========================================
15 // DEFAULTS
16 // ========================================
17 pub const TERMINAL: &str = "alacritty";
18 pub const MODKEY: KeyButMask = KeyButMask::MOD1;
19
20 // ========================================
21 // BAR COLORS
22 // ========================================
23
24 // Base colors
25 const GRAY_DARK: u32 = 0x222222;
26 const GRAY_MID: u32 = 0x444444;
27 const GRAY_LIGHT: u32 = 0xbbbbbb;
28 // const GRAY_LIGHTEST: u32 = 0xeeeeee;
29 const CYAN: u32 = 0x6dade3;
30 const MAGENTA: u32 = 0xad8ee6;
31
32 pub struct ColorScheme {
33 pub foreground: u32,
34 pub background: u32,
35 pub border: u32,
36 }
37
38 pub const SCHEME_NORMAL: ColorScheme = ColorScheme {
39 foreground: GRAY_LIGHT,
40 background: GRAY_DARK,
41 border: GRAY_MID,
42 };
43
44 // pub const SCHEME_OCCUPIED: ColorScheme = ColorScheme {
45 // foreground: CYAN,
46 // background: GRAY_DARK,
47 // border: CYAN,
48 // };
49
50 pub const SCHEME_SELECTED: ColorScheme = ColorScheme {
51 foreground: CYAN,
52 background: GRAY_DARK,
53 border: MAGENTA,
54 };
55
56 // ========================================
57 // Commands
58 // ========================================
59 const SCREENSHOT_CMD: &[&str] = &[
60 "sh",
61 "-c",
62 "maim ~/screenshots/screenshot_$(date +%Y%m%d_%H%M%S).png",
63 ];
64
65 const DMENU_CMD: &[&str] = &["sh", "-c", "dmenu_run -l 10"];
66
67 // ========================================
68 // TAGS
69 // ========================================
70 pub const TAG_COUNT: usize = 9;
71 pub const TAGS: [&str; TAG_COUNT] = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
72
73 // ========================================
74 // KEYBINDINGS
75 // ========================================
76 #[rustfmt::skip]
77 pub const KEYBINDINGS: &[Key] = &[
78 Key::new(&[MODKEY], keycodes::RETURN, KeyAction::Spawn, Arg::Str(TERMINAL)),
79
80 Key::new(&[MODKEY], keycodes::S, KeyAction::Spawn, Arg::Array(SCREENSHOT_CMD)),
81 Key::new(&[MODKEY], keycodes::D, KeyAction::Spawn, Arg::Array(DMENU_CMD)),
82 Key::new(&[MODKEY], keycodes::Q, KeyAction::KillClient, Arg::None),
83 Key::new(&[MODKEY, SHIFT], keycodes::Q, KeyAction::Quit, Arg::None),
84 Key::new(&[MODKEY], keycodes::J, KeyAction::FocusStack, Arg::Int(-1)),
85 Key::new(&[MODKEY], keycodes::K, KeyAction::FocusStack, Arg::Int(1)),
86
87 Key::new(&[MODKEY], keycodes::KEY_1, KeyAction::ViewTag, Arg::Int(0)),
88 Key::new(&[MODKEY], keycodes::KEY_2, KeyAction::ViewTag, Arg::Int(1)),
89 Key::new(&[MODKEY], keycodes::KEY_3, KeyAction::ViewTag, Arg::Int(2)),
90 Key::new(&[MODKEY], keycodes::KEY_4, KeyAction::ViewTag, Arg::Int(3)),
91 Key::new(&[MODKEY], keycodes::KEY_5, KeyAction::ViewTag, Arg::Int(4)),
92 Key::new(&[MODKEY], keycodes::KEY_6, KeyAction::ViewTag, Arg::Int(5)),
93 Key::new(&[MODKEY], keycodes::KEY_7, KeyAction::ViewTag, Arg::Int(6)),
94 Key::new(&[MODKEY], keycodes::KEY_8, KeyAction::ViewTag, Arg::Int(7)),
95 Key::new(&[MODKEY], keycodes::KEY_9, KeyAction::ViewTag, Arg::Int(8)),
96
97 Key::new(&[MODKEY, SHIFT], keycodes::KEY_1, KeyAction::MoveToTag, Arg::Int(0)),
98 Key::new(&[MODKEY, SHIFT], keycodes::KEY_2, KeyAction::MoveToTag, Arg::Int(1)),
99 Key::new(&[MODKEY, SHIFT], keycodes::KEY_3, KeyAction::MoveToTag, Arg::Int(2)),
100 Key::new(&[MODKEY, SHIFT], keycodes::KEY_4, KeyAction::MoveToTag, Arg::Int(3)),
101 Key::new(&[MODKEY, SHIFT], keycodes::KEY_5, KeyAction::MoveToTag, Arg::Int(4)),
102 Key::new(&[MODKEY, SHIFT], keycodes::KEY_6, KeyAction::MoveToTag, Arg::Int(5)),
103 Key::new(&[MODKEY, SHIFT], keycodes::KEY_7, KeyAction::MoveToTag, Arg::Int(6)),
104 Key::new(&[MODKEY, SHIFT], keycodes::KEY_8, KeyAction::MoveToTag, Arg::Int(7)),
105 Key::new(&[MODKEY, SHIFT], keycodes::KEY_9, KeyAction::MoveToTag, Arg::Int(8)),
106 ];
107
108 const SHIFT: KeyButMask = KeyButMask::SHIFT;