From 6877e5737d28ae38c636040dd05cf6a0be654bae Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 28 Nov 2019 00:09:43 +0530 Subject: add configuration-ism --- src/main.rs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src') 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 @@ use std::thread; use std::time::{Duration, Instant}; -fn main() { - let win_width = 500u16; - let win_height = 500u16; +struct Configuration { + max_size: u16, // display pixels + duration: u16, // milliseconds + thickness: u32, // display pixels + no_of_circles: u16, +} - let (conn, screen_num) = xcb::Connection::connect(None).unwrap(); +fn main() { + let config = Configuration { + max_size: 200u16, + duration: 600u16, + thickness: 1, + no_of_circles: 6, + }; + let win_width = config.max_size; + let win_height = config.max_size; + + let (conn, screen_num) = xcb::Connection::connect(None) + .unwrap_or_else(|e| panic!("Unable to connect to X session: {}", e)); let setup = conn.get_setup(); let screen = setup.roots().nth(screen_num as usize).unwrap(); -- cgit v1.2.3