Allow X11 and Wayland per default
This commit is contained in:
@ -32,8 +32,16 @@ impl App {
|
||||
|
||||
ctx.set_fonts(fonts);
|
||||
|
||||
// first argument is the initial path or the current working directory
|
||||
|
||||
let initial_path = if let Some(path) = std::env::args().nth(1) {
|
||||
std::path::PathBuf::from(path)
|
||||
} else {
|
||||
std::env::current_dir().unwrap()
|
||||
};
|
||||
|
||||
App {
|
||||
tree: Tree::new(),
|
||||
tree: Tree::new(initial_path),
|
||||
editor: ACLEditor::new(),
|
||||
}
|
||||
}
|
||||
|
@ -13,9 +13,12 @@ pub struct Tree {
|
||||
}
|
||||
|
||||
impl Tree {
|
||||
pub fn new() -> Self {
|
||||
pub fn new(initial_path: impl Into<PathBuf>) -> Self {
|
||||
let path: PathBuf = initial_path.into();
|
||||
let name = path.to_string_lossy().to_string();
|
||||
|
||||
Self {
|
||||
root: Folder::new("./tmp", "./tmp"),
|
||||
root: Folder::new(name, path),
|
||||
selected: PathBuf::new(),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user