Skip to content

Commit 07544e8

Browse files
committed
dont add hidden apps
1 parent 60bc0e2 commit 07544e8

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rlaunch"
3-
version = "1.3.6"
3+
version = "1.3.7"
44
authors = ["Ponas <mykolas.peteraitis@gmail.com>"]
55
edition = "2018"
66

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This should work on all linux distributions and DEs that use X11, but if it does
1212
### Usage
1313

1414
```
15-
rlaunch 1.3.5
15+
rlaunch 1.3.7
1616
A simple and light-weight tool for launching applications and running commands on X11.
1717
1818
USAGE:

src/applications.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fn do_read_applications(
3333

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

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

@@ -58,7 +58,19 @@ fn do_read_applications(
5858
let mut app_type = String::new();
5959
let mut terminal = String::new();
6060
for line in contents.lines() {
61-
if exec == "" && line.starts_with("Exec=") {
61+
if line.starts_with("Hidden=") {
62+
let mut hidden = line[7..].to_string();
63+
// remove quotes if present
64+
if hidden.len() > 1 && hidden.starts_with('"') && hidden.ends_with('"') {
65+
hidden = hidden[1..hidden.len() - 1].to_string();
66+
}
67+
match hidden.trim().to_lowercase().parse() {
68+
Err(_) | Ok(true) => { // hidden or couldnt parse
69+
continue 'files;
70+
},
71+
_ => {},
72+
}
73+
} else if exec == "" && line.starts_with("Exec=") {
6274
exec = line[5..].to_string();
6375
// remove any arguments
6476
while let Some(i) = exec.find('%') {

0 commit comments

Comments
 (0)