Commit b7b861de authored by Jeremy Soller's avatar Jeremy Soller

Activate orbital screen on load

parent 4efc72b0
......@@ -50,9 +50,15 @@ impl SchemeMut for DisplayScheme {
Err(Error::new(EACCES))
}
} else {
let path_str = str::from_utf8(path).unwrap_or("");
let id = path_str.parse::<usize>().unwrap_or(0);
let path_str = str::from_utf8(path).unwrap_or("").trim_matches('/');
let mut parts = path_str.split('/');
let id = parts.next().unwrap_or("").parse::<usize>().unwrap_or(0);
if self.screens.contains_key(&id) {
for cmd in parts {
if cmd == "activate" {
self.active = id;
}
}
Ok(id)
} else {
Err(Error::new(ENOENT))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment