tony / oxwm

Branch: 11ec361
Switch branches/tags
master
xsoder Merge branch 'master' of github.com:xsoder/oxwm 11ec361 2025-10-09
204 lines · 7.3 KB Raw Blame History
1 use crate::bar::{BlockCommand, BlockConfig};
2 use crate::keyboard::handlers::Key;
3 use crate::keyboard::{Arg, KeyAction, keycodes};
4 use x11rb::protocol::xproto::KeyButMask;
5
6 // ========================================
7 // APPEARANCE
8 // ========================================
9 pub const BORDER_WIDTH: u32 = 2;
10 pub const BORDER_FOCUSED: u32 = 0x6dade3;
11 pub const BORDER_UNFOCUSED: u32 = 0xbbbbbb;
12 <<<<<<< HEAD
13 pub const FONT: &str = "IosevkaNerdFont:style=Bold:size=10";
14 =======
15 pub const FONT: &str = "JetBrainsMono Nerd Font:style=Bold:size=12";
16 >>>>>>> 303f7c23b69b0d88c8acc14ec438aca4053017bf
17
18 // ========================================
19 // GAPS (Vanity Gaps)
20 // ========================================
21 <<<<<<< HEAD
22 pub const GAPS_ENABLED: bool = false;
23 pub const GAP_INNER_HORIZONTAL: u32 = 3;
24 pub const GAP_INNER_VERTICAL: u32 = 3;
25 pub const GAP_OUTER_HORIZONTAL: u32 = 3;
26 pub const GAP_OUTER_VERTICAL: u32 = 3;
27 //
28 =======
29 pub const GAPS_ENABLED: bool = true;
30 pub const GAP_INNER_HORIZONTAL: u32 = 6;
31 pub const GAP_INNER_VERTICAL: u32 = 6;
32 pub const GAP_OUTER_HORIZONTAL: u32 = 6;
33 pub const GAP_OUTER_VERTICAL: u32 = 6;
34
35 >>>>>>> 303f7c23b69b0d88c8acc14ec438aca4053017bf
36 // ========================================
37 // DEFAULTS
38 // ========================================
39 pub const TERMINAL: &str = "st";
40 pub const XCLOCK: &str = "xclock";
41 pub const MODKEY: KeyButMask = KeyButMask::MOD4;
42
43 // ========================================
44 // BAR COLORS
45 // ========================================
46
47 // Base colors
48 const GRAY_DARK: u32 = 0x1a1b26;
49 const GRAY_SEP: u32 = 0xa9b1d6;
50 const GRAY_MID: u32 = 0x444444;
51 const GRAY_LIGHT: u32 = 0xbbbbbb;
52 const CYAN: u32 = 0x0db9d7;
53 const MAGENTA: u32 = 0xad8ee6;
54 const RED: u32 = 0xf7768e;
55 const GREEN: u32 = 0x9ece6a;
56 const BLUE: u32 = 0x7aa2f7;
57 const YELLOW: u32 = 0xe0af68;
58
59 pub struct ColorScheme {
60 pub foreground: u32,
61 pub background: u32,
62 pub underline: u32,
63 }
64
65 pub const SCHEME_NORMAL: ColorScheme = ColorScheme {
66 foreground: GRAY_LIGHT,
67 background: GRAY_DARK,
68 underline: GRAY_MID,
69 };
70
71 pub const SCHEME_OCCUPIED: ColorScheme = ColorScheme {
72 foreground: CYAN,
73 background: GRAY_DARK,
74 underline: CYAN,
75 };
76
77 pub const SCHEME_SELECTED: ColorScheme = ColorScheme {
78 foreground: CYAN,
79 background: GRAY_DARK,
80 underline: MAGENTA,
81 };
82
83 // ========================================
84 // Commands
85 // ========================================
86 const SCREENSHOT_CMD: &[&str] = &[
87 "sh", "-c","/home/xsoder/scripts/screeshot",
88 ];
89
90 const DMENU_CMD: &[&str] = &["sh", "-c", "dmenu_run"];
91 const ZOOM_CMD: &[&str] = &["sh", "-c", "boomer"];
92 const SCRIPT_CMD: &[&str] = &["sh", "-c", "/home/xsoder/scripts/master"];
93
94 // ========================================
95 // TAGS
96 // ========================================
97 pub const TAG_COUNT: usize = 9;
98 pub const TAGS: [&str; TAG_COUNT] = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
99 //pub const TAGS: [&str; TAG_COUNT] = ["", "󰊯", "", "", "󰙯", "󱇤", "", "󱘶", "󰧮"];
100 // pub const TAGS: [&str; TAG_COUNT] = [
101 // "DEV", "WWW", "SYS", "DOC", "VBOX", "CHAT", "MUS", "VID", "MISC",
102 // ];
103
104 // ========================================
105 // KEYBINDINGS
106 // ========================================
107 #[rustfmt::skip]
108 pub const KEYBINDINGS: &[Key] = &[
109 Key::new(&[MODKEY], keycodes::RETURN, KeyAction::Spawn, Arg::Str(TERMINAL)),
110
111 Key::new(&[MODKEY], keycodes::D, KeyAction::Spawn, Arg::Array(DMENU_CMD)),
112 Key::new(&[MODKEY], keycodes::Z, KeyAction::Spawn, Arg::Array(ZOOM_CMD)),
113 Key::new(&[MODKEY, SHIFT], keycodes::S, KeyAction::Spawn, Arg::Array(SCREENSHOT_CMD)),
114 Key::new(&[MODKEY], keycodes::O, KeyAction::Spawn, Arg::Array(SCRIPT_CMD)),
115 Key::new(&[MODKEY], keycodes::Q, KeyAction::KillClient, Arg::None),
116 Key::new(&[MODKEY], keycodes::F, KeyAction::ToggleFullScreen, Arg::None),
117 Key::new(&[MODKEY], keycodes::A, KeyAction::ToggleGaps, Arg::None),
118 Key::new(&[MODKEY, SHIFT], keycodes::Q, KeyAction::Quit, Arg::None),
119 Key::new(&[MODKEY, SHIFT], keycodes::R, KeyAction::Restart, Arg::None),
120 Key::new(&[MODKEY], keycodes::J, KeyAction::FocusStack, Arg::Int(-1)),
121 Key::new(&[MODKEY], keycodes::K, KeyAction::FocusStack, Arg::Int(1)),
122
123 Key::new(&[MODKEY], keycodes::KEY_1, KeyAction::ViewTag, Arg::Int(0)),
124 Key::new(&[MODKEY], keycodes::KEY_2, KeyAction::ViewTag, Arg::Int(1)),
125 Key::new(&[MODKEY], keycodes::KEY_3, KeyAction::ViewTag, Arg::Int(2)),
126 Key::new(&[MODKEY], keycodes::KEY_4, KeyAction::ViewTag, Arg::Int(3)),
127 Key::new(&[MODKEY], keycodes::KEY_5, KeyAction::ViewTag, Arg::Int(4)),
128 Key::new(&[MODKEY], keycodes::KEY_6, KeyAction::ViewTag, Arg::Int(5)),
129 Key::new(&[MODKEY], keycodes::KEY_7, KeyAction::ViewTag, Arg::Int(6)),
130 Key::new(&[MODKEY], keycodes::KEY_8, KeyAction::ViewTag, Arg::Int(7)),
131 Key::new(&[MODKEY], keycodes::KEY_9, KeyAction::ViewTag, Arg::Int(8)),
132
133 Key::new(&[MODKEY, SHIFT], keycodes::KEY_1, KeyAction::MoveToTag, Arg::Int(0)),
134 Key::new(&[MODKEY, SHIFT], keycodes::KEY_2, KeyAction::MoveToTag, Arg::Int(1)),
135 Key::new(&[MODKEY, SHIFT], keycodes::KEY_3, KeyAction::MoveToTag, Arg::Int(2)),
136 Key::new(&[MODKEY, SHIFT], keycodes::KEY_4, KeyAction::MoveToTag, Arg::Int(3)),
137 Key::new(&[MODKEY, SHIFT], keycodes::KEY_5, KeyAction::MoveToTag, Arg::Int(4)),
138 Key::new(&[MODKEY, SHIFT], keycodes::KEY_6, KeyAction::MoveToTag, Arg::Int(5)),
139 Key::new(&[MODKEY, SHIFT], keycodes::KEY_7, KeyAction::MoveToTag, Arg::Int(6)),
140 Key::new(&[MODKEY, SHIFT], keycodes::KEY_8, KeyAction::MoveToTag, Arg::Int(7)),
141 Key::new(&[MODKEY, SHIFT], keycodes::KEY_9, KeyAction::MoveToTag, Arg::Int(8)),
142 ];
143
144 // ========================================
145 // STATUS BAR BLOCKS
146 // ========================================
147 pub const STATUS_BLOCKS: &[BlockConfig] = &[
148 BlockConfig {
149 format: "",
150 command: BlockCommand::Battery {
151 format_charging: "󰂄 Bat: {}%",
152 format_discharging: "󰁹 Bat:{}%",
153 format_full: "󰁹 Bat: {}%",
154 },
155 interval_secs: 30,
156 color: GREEN,
157 underline: true,
158 },
159 BlockConfig {
160 format: " │ ",
161 command: BlockCommand::Static(""),
162 interval_secs: u64::MAX,
163 color: GRAY_SEP,
164 underline: false,
165 },
166 BlockConfig {
167 format: "󰍛 {used}/{total} GB",
168 command: BlockCommand::Ram,
169 interval_secs: 5,
170 color: BLUE,
171 underline: true,
172 },
173 BlockConfig {
174 format: " │ ",
175 command: BlockCommand::Static(""),
176 interval_secs: u64::MAX,
177 color: GRAY_SEP,
178 underline: false,
179 },
180 BlockConfig {
181 format: " {}",
182 command: BlockCommand::Shell("uname -r"),
183 interval_secs: u64::MAX,
184 color: RED,
185 underline: true,
186 },
187 BlockConfig {
188 format: " │ ",
189 command: BlockCommand::Static(""),
190 interval_secs: u64::MAX,
191 color: GRAY_SEP,
192 underline: false,
193 },
194 BlockConfig {
195 format: "󰸘 {}",
196 command: BlockCommand::DateTime("%a, %b %d - %-I:%M %P"),
197 interval_secs: 1,
198 color: CYAN,
199 underline: true,
200 },
201 ];
202
203 const SHIFT: KeyButMask = KeyButMask::SHIFT;
204 pub const WM_BINARY: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/target/release/oxwm");