Skip to content

Commit

Permalink
dont add hidden apps
Browse files Browse the repository at this point in the history
  • Loading branch information
PonasKovas committed Feb 29, 2020
1 parent 60bc0e2 commit 07544e8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rlaunch"
version = "1.3.6"
version = "1.3.7"
authors = ["Ponas <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This should work on all linux distributions and DEs that use X11, but if it does
### Usage

```
rlaunch 1.3.5
rlaunch 1.3.7
A simple and light-weight tool for launching applications and running commands on X11.
USAGE:
Expand Down
16 changes: 14 additions & 2 deletions src/applications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn do_read_applications(

progress.lock().unwrap().1 = files.len() as u32;

for file in files {
'files: for file in files {
// update progress
progress.lock().unwrap().0 += 1;

Expand All @@ -58,7 +58,19 @@ fn do_read_applications(
let mut app_type = String::new();
let mut terminal = String::new();
for line in contents.lines() {
if exec == "" && line.starts_with("Exec=") {
if line.starts_with("Hidden=") {
let mut hidden = line[7..].to_string();
// remove quotes if present
if hidden.len() > 1 && hidden.starts_with('"') && hidden.ends_with('"') {
hidden = hidden[1..hidden.len() - 1].to_string();
}
match hidden.trim().to_lowercase().parse() {
Err(_) | Ok(true) => { // hidden or couldnt parse
continue 'files;
},
_ => {},
}
} else if exec == "" && line.starts_with("Exec=") {
exec = line[5..].to_string();
// remove any arguments
while let Some(i) = exec.find('%') {
Expand Down

0 comments on commit 07544e8

Please sign in to comment.