This commit is contained in:
Kirottu
2023-04-11 11:18:12 +03:00
5 changed files with 43 additions and 13 deletions

View File

@@ -0,0 +1,13 @@
# Applications
## Desktop Actions
To enable desktop actions support, set `desktop_actions` in the applications plugin config
file to `true` like so:
`<anyrun config directory>/applications.ron`:
```ron
Config(
desktop_actions: true,
)
```

View File

@@ -31,11 +31,15 @@ impl DesktopEntry {
let mut line = None;
let mut new_sections = Vec::new();
for section in sections.iter() {
for (i, section) in sections.iter().enumerate() {
if let Some(line) = line {
let mut section = section.to_vec();
section.insert(0, line);
section.pop();
// Only pop the last redundant entry if it isn't the last item
if i < sections.len() - 1 {
section.pop();
}
new_sections.push(section);
}
line = Some(section.last().unwrap_or(&""));