Allow X11 and Wayland per default

This commit is contained in:
Fabian Stamm
2024-08-18 23:50:48 +02:00
parent c970c1dfbd
commit 3c44286570
4 changed files with 45 additions and 4 deletions

View File

@ -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(),
}
}

View File

@ -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(),
}
}