gdritter repos knurling / 3f46a16
Cargo fmt Getty Ritter 3 years ago
2 changed file(s) with 16 addition(s) and 5 deletion(s). Collapse all Expand all
4949 height: 0,
5050 buffer: 0,
5151 };
52 let table = input.as_table().ok_or_else(|| format_err!("invalid config"))?;
52 let table = input
53 .as_table()
54 .ok_or_else(|| format_err!("invalid config"))?;
5355 let widgets = &table["widgets"];
5456 let mut target = &mut conf.left;
55 for section in widgets.as_array().ok_or_else(|| format_err!("invalid config"))? {
56 let section = section.as_table().ok_or_else(|| format_err!("invalid config"))?;
57 match section["name"].as_str().ok_or_else(|| format_err!("invalid config"))? {
57 for section in widgets
58 .as_array()
59 .ok_or_else(|| format_err!("invalid config"))?
60 {
61 let section = section
62 .as_table()
63 .ok_or_else(|| format_err!("invalid config"))?;
64 match section["name"]
65 .as_str()
66 .ok_or_else(|| format_err!("invalid config"))?
67 {
5868 "box" => target.push(Box::new(w::SmallBox)),
5969 "battery" => target.push(Box::new(w::Battery::new()?)),
6070 "caesura" => target.push(Box::new(w::Caesura)),
269269 let mut cookie: xlib::XGenericEventCookie = unsafe { From::from(*e.as_ptr()) };
270270 unsafe { xlib::XGetEventData(self.display.display, &mut cookie) };
271271 if let xinput2::XI_ButtonPress = cookie.evtype {
272 let data: &xinput2::XIDeviceEvent = unsafe { &*(cookie.data as *const xinput2::XIDeviceEvent) };
272 let data: &xinput2::XIDeviceEvent =
273 unsafe { &*(cookie.data as *const xinput2::XIDeviceEvent) };
273274 return Some(Event::MouseEvent {
274275 x: data.event_x,
275276 y: data.event_y,