Cargo fmt
Getty Ritter
4 years ago
49 | 49 |
height: 0,
|
50 | 50 |
buffer: 0,
|
51 | 51 |
};
|
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"))?;
|
53 | 55 |
let widgets = &table["widgets"];
|
54 | 56 |
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 |
{
|
58 | 68 |
"box" => target.push(Box::new(w::SmallBox)),
|
59 | 69 |
"battery" => target.push(Box::new(w::Battery::new()?)),
|
60 | 70 |
"caesura" => target.push(Box::new(w::Caesura)),
|
269 | 269 |
let mut cookie: xlib::XGenericEventCookie = unsafe { From::from(*e.as_ptr()) };
|
270 | 270 |
unsafe { xlib::XGetEventData(self.display.display, &mut cookie) };
|
271 | 271 |
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) };
|
273 | 274 |
return Some(Event::MouseEvent {
|
274 | 275 |
x: data.event_x,
|
275 | 276 |
y: data.event_y,
|