tony / oxwm

Added blocks... lol Browse files
tonybtw committed 2025-10-04 parent 50d8817 commit d5b349987daf8bfe52a638a905be493c0e04bcd9
Showing 10 changed files with 508 additions and 7 deletions. UnifiedSplit
+277 −0 Cargo.lock
@@ -2,18 +2,74 @@
2 2 # It is not intended for manual editing.
3 3 version = 4
4 4
5 +[[package]]
6 +name = "android_system_properties"
7 +version = "0.1.5"
8 +source = "registry+https://github.com/rust-lang/crates.io-index"
9 +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
10 +dependencies = [
11 + "libc",
12 +]
13 +
5 14 [[package]]
6 15 name = "anyhow"
7 16 version = "1.0.99"
8 17 source = "registry+https://github.com/rust-lang/crates.io-index"
9 18 checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100"
10 19
20 +[[package]]
21 +name = "autocfg"
22 +version = "1.5.0"
23 +source = "registry+https://github.com/rust-lang/crates.io-index"
24 +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
25 +
11 26 [[package]]
12 27 name = "bitflags"
13 28 version = "2.9.4"
14 29 source = "registry+https://github.com/rust-lang/crates.io-index"
15 30 checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394"
16 31
32 +[[package]]
33 +name = "bumpalo"
34 +version = "3.19.0"
35 +source = "registry+https://github.com/rust-lang/crates.io-index"
36 +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
37 +
38 +[[package]]
39 +name = "cc"
40 +version = "1.2.40"
41 +source = "registry+https://github.com/rust-lang/crates.io-index"
42 +checksum = "e1d05d92f4b1fd76aad469d46cdd858ca761576082cd37df81416691e50199fb"
43 +dependencies = [
44 + "find-msvc-tools",
45 + "shlex",
46 +]
47 +
48 +[[package]]
49 +name = "cfg-if"
50 +version = "1.0.3"
51 +source = "registry+https://github.com/rust-lang/crates.io-index"
52 +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
53 +
54 +[[package]]
55 +name = "chrono"
56 +version = "0.4.42"
57 +source = "registry+https://github.com/rust-lang/crates.io-index"
58 +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2"
59 +dependencies = [
60 + "iana-time-zone",
61 + "js-sys",
62 + "num-traits",
63 + "wasm-bindgen",
64 + "windows-link",
65 +]
66 +
67 +[[package]]
68 +name = "core-foundation-sys"
69 +version = "0.8.7"
70 +source = "registry+https://github.com/rust-lang/crates.io-index"
71 +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
72 +
17 73 [[package]]
18 74 name = "errno"
19 75 version = "0.3.14"
@@ -24,6 +80,12 @@ dependencies = [
24 80 "windows-sys",
25 81 ]
26 82
83 +[[package]]
84 +name = "find-msvc-tools"
85 +version = "0.1.3"
86 +source = "registry+https://github.com/rust-lang/crates.io-index"
87 +checksum = "0399f9d26e5191ce32c498bebd31e7a3ceabc2745f0ac54af3f335126c3f24b3"
88 +
27 89 [[package]]
28 90 name = "gethostname"
29 91 version = "1.0.2"
@@ -34,6 +96,40 @@ dependencies = [
34 96 "windows-targets",
35 97 ]
36 98
99 +[[package]]
100 +name = "iana-time-zone"
101 +version = "0.1.64"
102 +source = "registry+https://github.com/rust-lang/crates.io-index"
103 +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb"
104 +dependencies = [
105 + "android_system_properties",
106 + "core-foundation-sys",
107 + "iana-time-zone-haiku",
108 + "js-sys",
109 + "log",
110 + "wasm-bindgen",
111 + "windows-core",
112 +]
113 +
114 +[[package]]
115 +name = "iana-time-zone-haiku"
116 +version = "0.1.2"
117 +source = "registry+https://github.com/rust-lang/crates.io-index"
118 +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
119 +dependencies = [
120 + "cc",
121 +]
122 +
123 +[[package]]
124 +name = "js-sys"
125 +version = "0.3.81"
126 +source = "registry+https://github.com/rust-lang/crates.io-index"
127 +checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305"
128 +dependencies = [
129 + "once_cell",
130 + "wasm-bindgen",
131 +]
132 +
37 133 [[package]]
38 134 name = "libc"
39 135 version = "0.2.175"
@@ -46,11 +142,33 @@ version = "0.11.0"
46 142 source = "registry+https://github.com/rust-lang/crates.io-index"
47 143 checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
48 144
145 +[[package]]
146 +name = "log"
147 +version = "0.4.28"
148 +source = "registry+https://github.com/rust-lang/crates.io-index"
149 +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
150 +
151 +[[package]]
152 +name = "num-traits"
153 +version = "0.2.19"
154 +source = "registry+https://github.com/rust-lang/crates.io-index"
155 +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
156 +dependencies = [
157 + "autocfg",
158 +]
159 +
160 +[[package]]
161 +name = "once_cell"
162 +version = "1.21.3"
163 +source = "registry+https://github.com/rust-lang/crates.io-index"
164 +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
165 +
49 166 [[package]]
50 167 name = "oxwm"
51 168 version = "0.1.0"
52 169 dependencies = [
53 170 "anyhow",
171 + "chrono",
54 172 "x11",
55 173 "x11rb",
56 174 ]
@@ -61,6 +179,24 @@ version = "0.3.32"
61 179 source = "registry+https://github.com/rust-lang/crates.io-index"
62 180 checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
63 181
182 +[[package]]
183 +name = "proc-macro2"
184 +version = "1.0.101"
185 +source = "registry+https://github.com/rust-lang/crates.io-index"
186 +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
187 +dependencies = [
188 + "unicode-ident",
189 +]
190 +
191 +[[package]]
192 +name = "quote"
193 +version = "1.0.41"
194 +source = "registry+https://github.com/rust-lang/crates.io-index"
195 +checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1"
196 +dependencies = [
197 + "proc-macro2",
198 +]
199 +
64 200 [[package]]
65 201 name = "rustix"
66 202 version = "1.1.2"
@@ -74,12 +210,153 @@ dependencies = [
74 210 "windows-sys",
75 211 ]
76 212
213 +[[package]]
214 +name = "rustversion"
215 +version = "1.0.22"
216 +source = "registry+https://github.com/rust-lang/crates.io-index"
217 +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
218 +
219 +[[package]]
220 +name = "shlex"
221 +version = "1.3.0"
222 +source = "registry+https://github.com/rust-lang/crates.io-index"
223 +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
224 +
225 +[[package]]
226 +name = "syn"
227 +version = "2.0.106"
228 +source = "registry+https://github.com/rust-lang/crates.io-index"
229 +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6"
230 +dependencies = [
231 + "proc-macro2",
232 + "quote",
233 + "unicode-ident",
234 +]
235 +
236 +[[package]]
237 +name = "unicode-ident"
238 +version = "1.0.19"
239 +source = "registry+https://github.com/rust-lang/crates.io-index"
240 +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d"
241 +
242 +[[package]]
243 +name = "wasm-bindgen"
244 +version = "0.2.104"
245 +source = "registry+https://github.com/rust-lang/crates.io-index"
246 +checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d"
247 +dependencies = [
248 + "cfg-if",
249 + "once_cell",
250 + "rustversion",
251 + "wasm-bindgen-macro",
252 + "wasm-bindgen-shared",
253 +]
254 +
255 +[[package]]
256 +name = "wasm-bindgen-backend"
257 +version = "0.2.104"
258 +source = "registry+https://github.com/rust-lang/crates.io-index"
259 +checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19"
260 +dependencies = [
261 + "bumpalo",
262 + "log",
263 + "proc-macro2",
264 + "quote",
265 + "syn",
266 + "wasm-bindgen-shared",
267 +]
268 +
269 +[[package]]
270 +name = "wasm-bindgen-macro"
271 +version = "0.2.104"
272 +source = "registry+https://github.com/rust-lang/crates.io-index"
273 +checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119"
274 +dependencies = [
275 + "quote",
276 + "wasm-bindgen-macro-support",
277 +]
278 +
279 +[[package]]
280 +name = "wasm-bindgen-macro-support"
281 +version = "0.2.104"
282 +source = "registry+https://github.com/rust-lang/crates.io-index"
283 +checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7"
284 +dependencies = [
285 + "proc-macro2",
286 + "quote",
287 + "syn",
288 + "wasm-bindgen-backend",
289 + "wasm-bindgen-shared",
290 +]
291 +
292 +[[package]]
293 +name = "wasm-bindgen-shared"
294 +version = "0.2.104"
295 +source = "registry+https://github.com/rust-lang/crates.io-index"
296 +checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1"
297 +dependencies = [
298 + "unicode-ident",
299 +]
300 +
301 +[[package]]
302 +name = "windows-core"
303 +version = "0.62.1"
304 +source = "registry+https://github.com/rust-lang/crates.io-index"
305 +checksum = "6844ee5416b285084d3d3fffd743b925a6c9385455f64f6d4fa3031c4c2749a9"
306 +dependencies = [
307 + "windows-implement",
308 + "windows-interface",
309 + "windows-link",
310 + "windows-result",
311 + "windows-strings",
312 +]
313 +
314 +[[package]]
315 +name = "windows-implement"
316 +version = "0.60.1"
317 +source = "registry+https://github.com/rust-lang/crates.io-index"
318 +checksum = "edb307e42a74fb6de9bf3a02d9712678b22399c87e6fa869d6dfcd8c1b7754e0"
319 +dependencies = [
320 + "proc-macro2",
321 + "quote",
322 + "syn",
323 +]
324 +
325 +[[package]]
326 +name = "windows-interface"
327 +version = "0.59.2"
328 +source = "registry+https://github.com/rust-lang/crates.io-index"
329 +checksum = "c0abd1ddbc6964ac14db11c7213d6532ef34bd9aa042c2e5935f59d7908b46a5"
330 +dependencies = [
331 + "proc-macro2",
332 + "quote",
333 + "syn",
334 +]
335 +
77 336 [[package]]
78 337 name = "windows-link"
79 338 version = "0.2.0"
80 339 source = "registry+https://github.com/rust-lang/crates.io-index"
81 340 checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65"
82 341
342 +[[package]]
343 +name = "windows-result"
344 +version = "0.4.0"
345 +source = "registry+https://github.com/rust-lang/crates.io-index"
346 +checksum = "7084dcc306f89883455a206237404d3eaf961e5bd7e0f312f7c91f57eb44167f"
347 +dependencies = [
348 + "windows-link",
349 +]
350 +
351 +[[package]]
352 +name = "windows-strings"
353 +version = "0.5.0"
354 +source = "registry+https://github.com/rust-lang/crates.io-index"
355 +checksum = "7218c655a553b0bed4426cf54b20d7ba363ef543b52d515b3e48d7fd55318dda"
356 +dependencies = [
357 + "windows-link",
358 +]
359 +
83 360 [[package]]
84 361 name = "windows-sys"
85 362 version = "0.61.0"
+1 −1 Cargo.toml
@@ -7,4 +7,4 @@ edition = "2024"
7 7 x11 = { version = "2.21", features = ["xlib", "xft"] }
8 8 x11rb = "0.13"
9 9 anyhow = "1"
10 -
10 +chrono = "0.4"
+72 −1 src/bar/bar.rs
@@ -1,6 +1,11 @@
1 +use super::blocks::{Block, Clock, Sep, Uname};
1 2 use super::font::{Font, FontDraw};
2 -use crate::config::{FONT, SCHEME_NORMAL, SCHEME_OCCUPIED, SCHEME_SELECTED, TAGS};
3 +use crate::config::{
4 + CLOCK_COLOR, CLOCK_FORMAT, FONT, SCHEME_NORMAL, SCHEME_OCCUPIED, SCHEME_SELECTED, SEP_COLOR,
5 + SEPARATOR, TAGS, UNAME_COLOR, UNAME_PREFIX,
6 +};
3 7 use anyhow::Result;
8 +use std::time::Instant;
4 9 use x11rb::COPY_DEPTH_FROM_PARENT;
5 10 use x11rb::connection::Connection;
6 11 use x11rb::protocol::xproto::*;
@@ -18,6 +23,10 @@ pub struct Bar {
18 23
19 24 tag_widths: Vec<u16>,
20 25 needs_redraw: bool,
26 +
27 + blocks: Vec<Box<dyn Block>>,
28 + block_last_updates: Vec<Instant>,
29 + status_text: String,
21 30 }
22 31
23 32 impl Bar {
@@ -78,6 +87,14 @@ impl Bar {
78 87 })
79 88 .collect();
80 89
90 + let blocks: Vec<Box<dyn Block>> = vec![
91 + Box::new(Uname::new(UNAME_PREFIX, UNAME_COLOR)),
92 + Box::new(Sep::new(SEPARATOR, SEP_COLOR)),
93 + Box::new(Clock::new(CLOCK_FORMAT, CLOCK_COLOR)),
94 + ];
95 +
96 + let block_last_updates = vec![Instant::now(); blocks.len()];
97 +
81 98 Ok(Bar {
82 99 window,
83 100 width,
@@ -88,6 +105,9 @@ impl Bar {
88 105 display,
89 106 tag_widths,
90 107 needs_redraw: true,
108 + blocks,
109 + block_last_updates,
110 + status_text: String::new(),
91 111 })
92 112 }
93 113
@@ -103,6 +123,35 @@ impl Bar {
103 123 self.needs_redraw = true;
104 124 }
105 125
126 + pub fn update_blocks(&mut self) -> Result<()> {
127 + let now = Instant::now();
128 + let mut changed = false;
129 +
130 + for (i, block) in self.blocks.iter_mut().enumerate() {
131 + let elapsed = now.duration_since(self.block_last_updates[i]);
132 +
133 + if elapsed >= block.interval() {
134 + if let Ok(_) = block.content() {
135 + self.block_last_updates[i] = now;
136 + changed = true;
137 + }
138 + }
139 + }
140 +
141 + if changed {
142 + let mut parts = Vec::new();
143 + for block in &mut self.blocks {
144 + if let Ok(text) = block.content() {
145 + parts.push(text);
146 + }
147 + }
148 + self.status_text = parts.join("");
149 + self.needs_redraw = true;
150 + }
151 +
152 + Ok(())
153 + }
154 +
106 155 pub fn draw(
107 156 &mut self,
108 157 connection: &RustConnection,
@@ -182,6 +231,25 @@ impl Bar {
182 231
183 232 x_position += tag_width as i16;
184 233 }
234 +
235 + if !self.status_text.is_empty() {
236 + let padding = 10;
237 + let mut x_position = self.width as i16 - padding;
238 +
239 + for block in self.blocks.iter_mut().rev() {
240 + if let Ok(text) = block.content() {
241 + let text_width = self.font.text_width(&text);
242 + x_position -= text_width as i16;
243 +
244 + let top_padding = 4;
245 + let text_y = top_padding + self.font.ascent();
246 +
247 + self.font_draw
248 + .draw_text(&self.font, block.color(), x_position, text_y, &text);
249 + }
250 + }
251 + }
252 +
185 253 connection.flush()?;
186 254
187 255 unsafe {
@@ -204,4 +272,7 @@ impl Bar {
204 272 }
205 273 None
206 274 }
275 + pub fn needs_redraw(&self) -> bool {
276 + self.needs_redraw
277 + }
207 278 }
+30 −0 src/bar/blocks/clock.rs new file mode 100644
@@ -0,0 +1,30 @@
1 +use super::Block;
2 +use anyhow::Result;
3 +use chrono::Local;
4 +use std::time::Duration;
5 +
6 +pub struct Clock {
7 + format: &'static str,
8 + color: u32,
9 +}
10 +
11 +impl Clock {
12 + pub fn new(format: &'static str, color: u32) -> Self {
13 + Self { format, color }
14 + }
15 +}
16 +
17 +impl Block for Clock {
18 + fn content(&mut self) -> Result<String> {
19 + let now = Local::now();
20 + Ok(now.format(self.format).to_string())
21 + }
22 +
23 + fn interval(&self) -> Duration {
24 + Duration::from_secs(1)
25 + }
26 +
27 + fn color(&self) -> u32 {
28 + self.color
29 + }
30 +}
+20 −0 src/bar/blocks/mod.rs new file mode 100644
@@ -0,0 +1,20 @@
1 +use anyhow::Result;
2 +use std::time::Duration;
3 +
4 +pub mod clock;
5 +pub mod sep;
6 +pub mod uname;
7 +
8 +pub use clock::Clock;
9 +pub use sep::Sep;
10 +pub use uname::Uname;
11 +
12 +pub trait Block {
13 + fn content(&mut self) -> Result<String>;
14 + fn interval(&self) -> Duration;
15 + fn color(&self) -> u32;
16 +
17 + fn on_click(&mut self) -> Result<()> {
18 + Ok(())
19 + }
20 +}
+28 −0 src/bar/blocks/sep.rs new file mode 100644
@@ -0,0 +1,28 @@
1 +use super::Block;
2 +use anyhow::Result;
3 +use std::time::Duration;
4 +
5 +pub struct Sep {
6 + text: &'static str,
7 + color: u32,
8 +}
9 +
10 +impl Sep {
11 + pub fn new(text: &'static str, color: u32) -> Self {
12 + Self { text, color }
13 + }
14 +}
15 +
16 +impl Block for Sep {
17 + fn content(&mut self) -> Result<String> {
18 + Ok(self.text.to_string())
19 + }
20 +
21 + fn interval(&self) -> Duration {
22 + Duration::from_secs(u64::MAX)
23 + }
24 +
25 + fn color(&self) -> u32 {
26 + self.color
27 + }
28 +}
+38 −0 src/bar/blocks/uname.rs new file mode 100644
@@ -0,0 +1,38 @@
1 +use super::Block;
2 +use anyhow::Result;
3 +use std::process::Command;
4 +use std::time::Duration;
5 +
6 +pub struct Uname {
7 + cached_version: String,
8 + prefix: &'static str,
9 + color: u32,
10 +}
11 +
12 +impl Uname {
13 + pub fn new(prefix: &'static str, color: u32) -> Self {
14 + Self {
15 + cached_version: String::new(),
16 + prefix,
17 + color,
18 + }
19 + }
20 +}
21 +
22 +impl Block for Uname {
23 + fn content(&mut self) -> Result<String> {
24 + if self.cached_version.is_empty() {
25 + let output = Command::new("uname").arg("-r").output()?;
26 + self.cached_version = String::from_utf8_lossy(&output.stdout).trim().to_string();
27 + }
28 + Ok(format!("{}{}", self.prefix, self.cached_version))
29 + }
30 +
31 + fn interval(&self) -> Duration {
32 + Duration::from_secs(u64::MAX)
33 + }
34 +
35 + fn color(&self) -> u32 {
36 + self.color
37 + }
38 +}
+1 −0 src/bar/mod.rs
@@ -1,4 +1,5 @@
1 1 mod bar;
2 +mod blocks;
2 3 mod font;
3 4 // mod widgets; // TODO: implement later
4 5
+15 −1 src/config.rs
@@ -24,8 +24,12 @@ pub const MODKEY: KeyButMask = KeyButMask::MOD1;
24 24 const GRAY_DARK: u32 = 0x222222;
25 25 const GRAY_MID: u32 = 0x444444;
26 26 const GRAY_LIGHT: u32 = 0xbbbbbb;
27 -const CYAN: u32 = 0x6dade3;
27 +const CYAN: u32 = 0x0db9d7;
28 28 const MAGENTA: u32 = 0xad8ee6;
29 +const RED: u32 = 0xf7768e;
30 +const GREEN: u32 = 0x9ece6a;
31 +const BLUE: u32 = 0x7aa2f7;
32 +const YELLOW: u32 = 0xe0af68;
29 33
30 34 pub struct ColorScheme {
31 35 pub foreground: u32,
@@ -103,4 +107,14 @@ pub const KEYBINDINGS: &[Key] = &[
103 107 Key::new(&[MODKEY, SHIFT], keycodes::KEY_9, KeyAction::MoveToTag, Arg::Int(8)),
104 108 ];
105 109
110 +// ========================================
111 +// STATUS BAR BLOCKS
112 +// ========================================
113 +pub const CLOCK_FORMAT: &str = " 󰸘 %a, %b %d - %-I:%M %P"; // "Fri, Oct 03 - 7:58 pm"
114 +pub const SEPARATOR: &str = " | ";
115 +pub const UNAME_COLOR: u32 = RED;
116 +pub const UNAME_PREFIX: &str = "  ";
117 +pub const SEP_COLOR: u32 = GRAY_LIGHT;
118 +pub const CLOCK_COLOR: u32 = CYAN;
119 +
106 120 const SHIFT: KeyButMask = KeyButMask::SHIFT;
+26 −4 src/window_manager.rs
@@ -1,13 +1,13 @@
1 1 use crate::bar::Bar;
2 2 use crate::config::{BORDER_FOCUSED, BORDER_UNFOCUSED, BORDER_WIDTH, TAG_COUNT};
3 3 use crate::keyboard::{self, Arg, KeyAction};
4 -use crate::layout::Layout;
5 4 use crate::layout::tiling::TilingLayout;
5 +use crate::layout::Layout;
6 6 use anyhow::Result;
7 7
8 8 use x11rb::connection::Connection;
9 -use x11rb::protocol::Event;
10 9 use x11rb::protocol::xproto::*;
10 +use x11rb::protocol::Event;
11 11 use x11rb::rust_connection::RustConnection;
12 12
13 13 pub type TagMask = u32;
@@ -70,11 +70,33 @@ impl WindowManager {
70 70 self.update_bar()?;
71 71
72 72 loop {
73 - let event = self.connection.wait_for_event()?;
74 - self.handle_event(event)?;
73 + self.bar.update_blocks()?;
74 +
75 + if let Ok(Some(event)) = self.connection.poll_for_event() {
76 + self.handle_event(event)?;
77 + }
78 +
79 + if self.bar.needs_redraw() {
80 + self.update_bar()?;
81 + }
82 +
83 + std::thread::sleep(std::time::Duration::from_millis(10));
75 84 }
76 85 }
77 86
87 + // pub fn run(&mut self) -> Result<()> {
88 + // println!("oxwm started on display {}", self.screen_number);
89 + //
90 + // keyboard::setup_keybinds(&self.connection, self.root)?;
91 + //
92 + // self.update_bar()?;
93 + //
94 + // loop {
95 + // let event = self.connection.wait_for_event()?;
96 + // self.handle_event(event)?;
97 + // }
98 + // }
99 +
78 100 fn update_bar(&mut self) -> Result<()> {
79 101 let mut occupied_tags: TagMask = 0;
80 102 for &tags in self.window_tags.values() {