psykopear / fuzzle Goto Github PK
View Code? Open in Web Editor NEWFast application launcher
License: MIT License
Fast application launcher
License: MIT License
When fuzzle
builds its cache based on .desktop
files, it assumes that each data directory listed by xdg
has an applications
subdirectory.
This is not always the case and when it's not fuzzle
panics. This is the code responsible for the panic.
pub fn build_cache() -> Vec<SearchResult> {
let mut results: Vec<SearchResult> = Vec::new();
// Build SearchResults for all desktop files we can find
for mut data_dir in search_dirs() {
data_dir.push("applications"); // <--- here you push applications
results.append(
&mut fs::read_dir(data_dir)
.expect("Can't find data dir")
.filter_map(|path| searchresult_from_desktopentry(&path.unwrap().path()))
.collect(),
);
}
// ...
}
After you append applications
to each data dir path I would check if the resulting directory exists before you try to read its entries.
fuzzle
panics because it search on the hard-coded path /home/docler/...
May I suggest to use the content of the PATH
environment variable to get a list of binary paths?
Anyway here you should remove the expect
and fail gracefully
for dir in &["/usr/bin", "/usr/local/bin", "/home/docler/.local/bin/"] {
results.append(
&mut fs::read_dir(dir)
.expect("Can't find /usr/bin")
.filter_map(|path| searchresult_from_bin(&path.unwrap().path()))
.collect(),
);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.