tony / oxwm

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