diff options
author | Akshay <[email protected]> | 2019-11-27 18:39:43 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2019-11-27 18:39:43 +0000 |
commit | 6877e5737d28ae38c636040dd05cf6a0be654bae (patch) | |
tree | 4c56ca47beec94d213529d3ca994b8a67d7811c5 | |
parent | fc992eb1d3f9b03751a6138a24d93f37ac5ce484 (diff) |
add configuration-ism
-rw-r--r-- | src/main.rs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 8f9a8aa..920608d 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -1,11 +1,25 @@ | |||
1 | use std::thread; | 1 | use std::thread; |
2 | use std::time::{Duration, Instant}; | 2 | use std::time::{Duration, Instant}; |
3 | 3 | ||
4 | fn main() { | 4 | struct Configuration { |
5 | let win_width = 500u16; | 5 | max_size: u16, // display pixels |
6 | let win_height = 500u16; | 6 | duration: u16, // milliseconds |
7 | thickness: u32, // display pixels | ||
8 | no_of_circles: u16, | ||
9 | } | ||
7 | 10 | ||
8 | let (conn, screen_num) = xcb::Connection::connect(None).unwrap(); | 11 | fn main() { |
12 | let config = Configuration { | ||
13 | max_size: 200u16, | ||
14 | duration: 600u16, | ||
15 | thickness: 1, | ||
16 | no_of_circles: 6, | ||
17 | }; | ||
18 | let win_width = config.max_size; | ||
19 | let win_height = config.max_size; | ||
20 | |||
21 | let (conn, screen_num) = xcb::Connection::connect(None) | ||
22 | .unwrap_or_else(|e| panic!("Unable to connect to X session: {}", e)); | ||
9 | let setup = conn.get_setup(); | 23 | let setup = conn.get_setup(); |
10 | let screen = setup.roots().nth(screen_num as usize).unwrap(); | 24 | let screen = setup.roots().nth(screen_num as usize).unwrap(); |
11 | 25 | ||