Skip to content

Commit

Permalink
Fix error "Invalid desktop file" by adding an Exec key to trash action (
Browse files Browse the repository at this point in the history
#100)

.. for desktop environments other than KDE or Gnome.

Otherwise, an error notification will be shown and ~/.xsession-errors
will contain a similar message:

ERROR desktop-file-validate: exit status 1
/home/user/.local/share/applications/appimagekit_d2a6a5eadca61238f89301b8918634f3.desktop: error: required key "Exec" in group "Desktop Action Trash" is not present
ERROR: Desktop file contains errors. Please fix them. Please see https://standards.freedesktop.org/desktop-entry-spec/1.0
2020/11/23 17:33:53 ----------------------------
2020/11/23 17:33:53 Notification:
2020/11/23 17:33:53 Invalid desktop file
  • Loading branch information
eMPee584 authored Nov 23, 2020
1 parent be9cdde commit bdff4e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/appimaged/desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ func writeDesktopFile(ai AppImage) {
} else if helpers.IsCommandAvailable("kioclient") {
// Of course KDE has its own facility for doing the exact same thing
cfg.Section("Desktop Action Trash").Key("Exec").SetValue("kioclient move \"" + ai.path + "\" trash:/")
} else {
// Provide a fallback shell command to prevent parser errors on other desktops
cfg.Section("Desktop Action Trash").Key("Exec").SetValue("mv \"" + ai.path + "\" ~/.local/share/Trash/")
}

// Add OpenPortableHome action
Expand Down

0 comments on commit bdff4e9

Please sign in to comment.