desktop-file-utils issueshttps://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues2023-10-05T14:03:21Zhttps://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/71Improper escape for print_warning in desktop-file-validate2023-10-05T14:03:21ZKonrad GawdaImproper escape for print_warning in desktop-file-validateI have tried validating my file with `desktop-file-validate`. The resulting printout was:
```
error: value "..." for key "Exec" in group "Desktop Entry" may contain at most one "0,000000", "102", "0,000000" or "%U" field code
```
Instead...I have tried validating my file with `desktop-file-validate`. The resulting printout was:
```
error: value "..." for key "Exec" in group "Desktop Entry" may contain at most one "0,000000", "102", "0,000000" or "%U" field code
```
Instead of `"0,000000", "102", "0,000000"` it should print `"%f", "%u", ""%F"`.
This must be a result of improper escape of `%` around here:
https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/blob/master/src/validate.c#L1334https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/70Add a new option to treat warnings as errors2023-04-24T13:28:24ZYegor YefremovAdd a new option to treat warnings as errorsAdd an option `--warn-as-error` that will cause `desktop-file-validate` to return 1 if any warnings is detected.Add an option `--warn-as-error` that will cause `desktop-file-validate` to return 1 if any warnings is detected.https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/69Please release 0.272023-10-05T15:59:11ZCimbaliPlease release 0.27I currently have issues with `desktop-file-validate` giving the error message `value "1.5" for key "Version" in group "Desktop Entry" is not a known version`
This issue was addressed over a year ago in 56d220dd679c7c3a8f995a41a27a7d6f3d...I currently have issues with `desktop-file-validate` giving the error message `value "1.5" for key "Version" in group "Desktop Entry" is not a known version`
This issue was addressed over a year ago in 56d220dd679c7c3a8f995a41a27a7d6f3df49dea but it is not part of the latest release 0.26.
Would you please consider releasing the current master under 0.27 so that compliant desktop files can validate with the latest `desktop-file-utils`?
Thanks!https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/68proposal: desktop-file-validate warning on single char tilde directory '~'2023-03-20T16:23:56ZFotis Koutoupasproposal: desktop-file-validate warning on single char tilde directory '~'So that users that put user home path aliases in path keys such as `Exec` or `Icon` are being warned they won't point to the user's home directory.
### Example desktop file keys
Warning-triggering keys:
```
Icon="~/opt/obsidian/favicon...So that users that put user home path aliases in path keys such as `Exec` or `Icon` are being warned they won't point to the user's home directory.
### Example desktop file keys
Warning-triggering keys:
```
Icon="~/opt/obsidian/favicon.ico"
Exec="~/opt/obsidian/Obsidian-1.1.9.AppImage"
```
Passing keys:
```
Icon=/home/user/opt/obsidian/favicon.ico
Exec=/home/user/opt/obsidian/Obsidian-1.1.9.AppImage
```https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/67Detect recursive MIME subclassing in update-desktop-database2023-01-05T15:10:16ZPhilip WithnallDetect recursive MIME subclassing in update-desktop-databaseSee https://gitlab.gnome.org/GNOME/glib/-/issues/2833
It’s possible for a mime-info XML file to define two (or more) mime-types which subclass each other in a loop. This is currently happily compiled into the desktop database, but then ...See https://gitlab.gnome.org/GNOME/glib/-/issues/2833
It’s possible for a mime-info XML file to define two (or more) mime-types which subclass each other in a loop. This is currently happily compiled into the desktop database, but then causes GLib to crash with an infinite recursion due to the loop.
It would be good to catch such loops in `update-desktop-database` itself, rather than having to check for them at runtime every time the database is loaded.https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/66desktop-file-validate does not detect unquoted backslashes2023-01-02T20:52:22ZCarsten Grohmanndesktop-file-validate does not detect unquoted backslashesI've an old `.desktop` file probably automatically generated by Wine. This file contains un-quoted arguments with backslash characters inside.
My understanding is that this violates the [desktop file standard](https://specifications.fre...I've an old `.desktop` file probably automatically generated by Wine. This file contains un-quoted arguments with backslash characters inside.
My understanding is that this violates the [desktop file standard](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html), as it specifies the following: `If an argument contains a reserved character the argument must be quoted. ... Reserved characters are ... backslash character ("\").`
The current version of `desktop-file-validate` doesn't complain about this:
**Steps to reproduce:**
```
$ cat .local/share/applications/wine/Programs/Exact\ Audio\ Copy/Exact\ Audio\ Copy.desktop
[Desktop Entry]
Name=Exact Audio Copy
Exec=env WINEPREFIX="/home/myuser/.wine" wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/myuser/.wine/dosdevices/c:/users/Public/Start\\ Menu/Programs/Exact\\ Audio\\ Copy/Exact\\ Audio\\ Copy.lnk
Type=Application
StartupNotify=true
Path=/home/myuser/.wine/dosdevices/c:/Program Files (x86)/Exact Audio Copy/Microsoft.VC80.CRT
Icon=723E_EAC.0
StartupWMClass=eac.exe
$ desktop-file-validate .local/share/applications/wine/Programs/Exact\ Audio\ Copy/Exact\ Audio\ Copy.desktop
$ echo $?
0
```
I think this behavior is a bug, what do you think about it?https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/65desktop-file-edit has no output2023-01-02T20:35:56ZCarsten Grohmanndesktop-file-edit has no output`desktop-file-edit` doesn't do anything:
```
$ ll
insgesamt 4
-rw-r--r-- 1 myuser mygroup 450 2. Jan 21:19 example.desktop
$ desktop-file-edit ./example.desktop
$ echo $?
0
$ pacman -Qo /usr/bin/desktop-file-edit
/usr/bin/desktop-...`desktop-file-edit` doesn't do anything:
```
$ ll
insgesamt 4
-rw-r--r-- 1 myuser mygroup 450 2. Jan 21:19 example.desktop
$ desktop-file-edit ./example.desktop
$ echo $?
0
$ pacman -Qo /usr/bin/desktop-file-edit
/usr/bin/desktop-file-edit is owned by desktop-file-utils 0.26-2
```
Please remove this file or add an output how to use or what's wrong.https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/64Consider adding --version2023-05-22T17:33:31ZCarsten GrohmannConsider adding --versionPlease add `--version` to all three desktop-file-* programs.Please add `--version` to all three desktop-file-* programs.https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/63validate: LXQt not supported in Categories2023-05-22T17:56:20Zrezsovalidate: LXQt not supported in CategoriesLXQt uses "LXQt" key in the Categories, but this is not supported by desktop-file-validate.
I tried to remove this key from LXQt projects, but this is rejected:
https://github.com/lxqt/lxqt-powermanagement/pull/329#issuecomment-1158053774LXQt uses "LXQt" key in the Categories, but this is not supported by desktop-file-validate.
I tried to remove this key from LXQt projects, but this is rejected:
https://github.com/lxqt/lxqt-powermanagement/pull/329#issuecomment-1158053774https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/62Type=Webapp2022-03-15T14:26:28ZGenghis KhanType=Webapp**DISCUSSION MOVED TO https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/89**
**DISCUSSION MOVED TO https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/89**
**DISCUSSION MOVED TO https://gitlab.freedesktop.org/xdg/xdg-specs/-/issu...**DISCUSSION MOVED TO https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/89**
**DISCUSSION MOVED TO https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/89**
**DISCUSSION MOVED TO https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/89**
_Web browsers can support it, webapp developers can make use of it._
---
Hello
I would like to propose a new type of Desktop shortcut.
**Type=Webapp**
Type=Webapp is mostly, if not solely, intended for easy and ideal association of web browsers with web-based software and protocol MIME types.
Example Desktop Entry File (Alice, Monitorix, Mumble and Transmission as examples)
```
[Desktop Entry]
Version=2.0
Type=Webapp
Name=Alice
Comment=Altogether Lovely Internet Chatting Experience
Link=http://localhost:8080/alice/
Icon=alice
MimeType=x-scheme-handler/irc;
Actions=Connect,Mute;Deafen;MOTD;
```
https://github.com/leedo/alice
```
[Desktop Entry]
Version=2.0
Type=Webapp
Name=Monitorix
Comment=Lightweight system monitoring tool
Link=http://localhost:8080/monitorix/
Icon=monitorix
Actions=System load,Memory allocation;Active processes;Entropy;Kernel usage;Context switches;VFS usage;Filesystems usage;Disk I/O activity;Inode usage;Time spent in I/O activity;IPv4 states;IPv6 states;Active close;Passive close;UDP statistics;System services demand;IMAP and POP3 services;SMTP service;Port 25 (IN-SMTP);Port 21 (IN-FTP);Port 80 (IN-HTTP);Port 22 (IN-SSH);Port 110 (IN-POP3);Port 139 (IN-NETBIOS);Port 3306 (IN-MYSQL);Port 53 (IN-DNS);Port 143 (IN-IMAP);Users logged in;Samba users;Netatalk users;Interrupt activity;Core activity;Interrupt activity;
```
https://www.monitorix.org/
```
[Desktop Entry]
Version=2.0
Type=Webapp
Name=Mumble Web
Comment=Low latency voice communication utility
Link=http://localhost:443/mumble/
Icon=mumble
MimeType=x-scheme-handler/mumble;
Actions=Connect,Mute;Deafen;MOTD;
```
https://github.com/Johni0702/mumble-web
```
[Desktop Entry]
Version=2.0
Type=Webapp
Name=Transmission Web
Comment=A fast and easy BitTorrent client
Link=http://localhost:9091/transmission/web/
Icon=transmission
MimeType=application/x-bittorrent;x-scheme-handler/magnet;
Actions=Active,Downloading,Seeding,Paused,Finished,Open Torrent,Pause All Torrents;Start All Torrents;
```
https://transmissionbt.com/
**How Type=Webapp differs from Type=Link?**
Type=Link will call to web browser or any default application that handles a given link.
Type=Webapp will call to web browser (or any default application...) but the web browser will know that it needs to be open without tabs and with the least amount of widgets.
**Advantages**
Per-Desktop: Webapp developers and package maintainers can make use of this an provide an easier setup for novice users, that otherwise wouldn't know how to enjoy a given webapp on their local machine.
**Security-wise:** This can also help to enhance security by automatically containing/isolating WebApps in an own instance/cache/cookies etc. For example, User wants to use a WebApp which is untrustworthy and does not respect privacy, so user can contain this WebApp by launching it from a seperate launcher. More info https://blog.mozilla.org/en/products/firefox/facebook-container-for-firefox/
Per-Client: Smaller amount of widgets can contribute to performance boosting.
Per-Server: Companies can use a single machine with multiple users who, on a given time, using the same executable, each operates under a different user.
**Consideration for companies** (see above: Per-Server)
In order to avoid the need to dedicate different ports for different users, interactive software will need to provide profile management system (i.e. login credentials user/password).
_Previously discussed at mailto:xdg@lists.freedesktop.org
Link: https://lists.freedesktop.org/archives/xdg/2016-January/013623.html_https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/61support for DesktopNames in the session.desktop files2021-12-07T14:04:15ZIgor Vlasenkosupport for DesktopNames in the session.desktop filesSupport for session files.
.desktop session files, as well as menu .desktop files and autostart .desktop files all have
Type=Application and the almost the same set of keys as menu .desktop files and autostart .desktop files but also ca...Support for session files.
.desktop session files, as well as menu .desktop files and autostart .desktop files all have
Type=Application and the almost the same set of keys as menu .desktop files and autostart .desktop files but also can have DesktopNames key as said in
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys :
"$XDG_CURRENT_DESKTOP should have been set by the login manager, according to the value of the DesktopNames found in the session file. The entry in the session file has multiple values separated in the usual way: with a semicolon. ..."
as of now desktop-file-validate does not support DesktopNames key:
desktop-file-validate /usr/share/xsessions/icewm-session.desktop
/usr/share/xsessions/icewm-session.desktop: error: file contains key "DesktopNames" in group "Desktop Entry", but keys extending the format should start with "X-"
The proposed patch adds support for DesktopNames key.
[desktop-file-utils-0.26-add-DesktopNames.patch](/uploads/9595732fafe6fa629627a592d3867438/desktop-file-utils-0.26-add-DesktopNames.patch)https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/60Line numbers in desktop-file-validate output2021-07-07T22:28:52ZPeter OliverLine numbers in desktop-file-validate outputIt would be helpful if `desktop-file-validate` included the line number of each issue in its output. This would allow the output to be parsed to, say, provide highlighting of issues within a text editor.It would be helpful if `desktop-file-validate` included the line number of each issue in its output. This would allow the output to be parsed to, say, provide highlighting of issues within a text editor.https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/59desktop-file-validate is missing support for version 1.5 of the specification2022-02-15T17:25:33ZSimon van der Veldtdesktop-file-validate is missing support for version 1.5 of the specificationAccording to the [docs](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html) the current version of the specification is 1.5
> Version | Version of the Desktop Entry Specification that the desktop entry conform...According to the [docs](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html) the current version of the specification is 1.5
> Version | Version of the Desktop Entry Specification that the desktop entry conforms with. Entries that confirm with this version of the specification should use 1.5. Note that the version field is not required to be present.
Yet when running desktop-file-validate against a `.desktop` file with `Version=1.5` in it I get the following error:
```
$ cat ~/Downloads/bitwig-studio.desktop
[Desktop Entry]
Version=1.5
Type=Application
Terminal=false
StartupNotify=true
Name=Bitwig Studio
Comment=Music Application
Exec="/usr/bin/bitwig-studio"
Categories=AudioVideo;Music;Audio;Sequencer;Midi;Mixer;Player;Recorder
MimeType=application/bitwig-clip;application/bitwig-device;application/bitwig-package;application/bitwig-preset;application/bitwig-project;application/bitwig-scene;application/bitwig-template
StartupWMClass="Bitwig Studio"
$ desktop-file-validate ~/Downloads/bitwig-studio.desktop
/home/simon/Downloads/bitwig-studio.desktop: error: value "1.5" for key "Version" in group "Desktop Entry" is not a known version
```https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/58meson does not install update-desktop-database2020-06-19T12:46:54ZAntoine Jacoutotmeson does not install update-desktop-databaseHi.
Not sure if this was intended but shouldn't desktop-file-update be update-desktop-database instead?
```Index: src/meson.build
--- src/meson.build.orig
+++ src/meson.build
@@ -24,7 +24,7 @@ executable('desktop-file-install',
inst...Hi.
Not sure if this was intended but shouldn't desktop-file-update be update-desktop-database instead?
```Index: src/meson.build
--- src/meson.build.orig
+++ src/meson.build
@@ -24,7 +24,7 @@ executable('desktop-file-install',
install: true,
)
-executable('desktop-file-update',
+executable('update-desktop-database',
'update-desktop-database.c',
link_with: desktop_file_lib,
dependencies: glib,```https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/57Fails to validate .desktop file with X-Geoclue-Reason keys2020-06-07T00:20:18ZMarcus LundbladFails to validate .desktop file with X-Geoclue-Reason keysThe desktop file for gnome-maps has a key X-Geoclue-Reason= that specifies a reason to grant location permission with GeoClue. In d-f-u master this fails to validate with the following error:
/home/marcus/maps/share/applications/org.gnom...The desktop file for gnome-maps has a key X-Geoclue-Reason= that specifies a reason to grant location permission with GeoClue. In d-f-u master this fails to validate with the following error:
/home/marcus/maps/share/applications/org.gnome.Maps.desktop: error: file contains key "X-Geoclue-Reason" in group "Desktop Entry", but keys extending the format should start with "X-"
It works in 0.24 (the version in Debian Bullseye, for example). I suspect it's related to recent changes related to deprecation support for X- keys.https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/56desktop-file-validate does not recognize \\" sequence in Exec quoted strings2020-06-18T16:51:08ZFrédéric Brièrefbriere@fbriere.netdesktop-file-validate does not recognize \\" sequence in Exec quoted strings[Electrum](https://github.com/spesmilo/electrum) ships a `.desktop` file with the following entry:
```
Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum %u"
```
`desktop-file-validate` is okay with this, but someone else begs t...[Electrum](https://github.com/spesmilo/electrum) ships a `.desktop` file with the following entry:
```
Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum %u"
```
`desktop-file-validate` is okay with this, but someone else begs to differ:
```
kf5.kconfig.core: "KConfigIni: In file /usr/share/applications/electrum.desktop, line 6: " "Invalid escape sequence \"\\\"\"."
kf5.kconfig.core: "KConfigIni: In file /usr/share/applications/electrum.desktop, line 6: " "Invalid escape sequence \"\\\"\"."
```
From what I can grasp from the Desktop Entry Specification, a double quote character within a quoted `Exec` string should be escaped as `\\"`, just like the backtick, dollar sign and backslash characters. However, `desktop-file-validate` does not agree:
```
Exec=sh -c "echo 'dollar:\\$ backtick:\\` backslash:\\\\ quotes:\\"'"
```
```
error: value "sh -c "echo 'dollar:\\$ backtick:\\` backslash:\\\\ quotes:\\"'"" for key "Exec" in group "Desktop Entry" contains a quote which is not closed
```
The bug seems to be at [line 1230](https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/blob/master/src/validate.c#L1230-1231), with the `if (!escaped)` lacking an `else escaped = FALSE`, to have the escaped double quote character "consume" the escaping. As it is, the escaping spreads to the closing quote, hence the "unclosed quote" error.
(Correspondingly, unsupported escape sequences should probably trigger an error or warning around [line 1281](https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/blob/master/src/validate.c#L1281-1282).)https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/55desktop-file-validate doesn't know about the Implements field2020-04-16T05:00:13ZDylan Bakerdesktop-file-validate doesn't know about the Implements fieldhttps://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/54Running update-desktop-database doesn't automatically regenerate user mimeinf...2022-12-21T10:02:53ZJay HarrisRunning update-desktop-database doesn't automatically regenerate user mimeinfo.cacheIn order to regenerate the mimeinfo.cache file for user mode *.desktop files you have to explicitly run update-desktop-database ~/.local/share/applications
It seems that this should be one of the default folders to get updated (a la /us...In order to regenerate the mimeinfo.cache file for user mode *.desktop files you have to explicitly run update-desktop-database ~/.local/share/applications
It seems that this should be one of the default folders to get updated (a la /usr/local/share/applications), as some file managers (Nautilus, Nemo) depend on the mimeinfo.cache file being up to date.https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/53C library to parse .desktop files2019-09-16T23:16:31ZJulien IsorceC library to parse .desktop filesIs there a C library to parse .desktop files ? (similar to https://gitlab.freedesktop.org/xdg/xdgmime/tree/master/src) Thx!Is there a C library to parse .desktop files ? (similar to https://gitlab.freedesktop.org/xdg/xdgmime/tree/master/src) Thx!https://gitlab.freedesktop.org/xdg/desktop-file-utils/-/issues/52desktop-file-validate claims OnlyShowIn is deprecated2019-07-23T18:23:18ZJonas Steindesktop-file-validate claims OnlyShowIn is deprecatedhttps://standards.freedesktop.org/menu-spec/latest/apb.html allows OnlyShowIn=Unity, but
https://bazaar.launchpad.net/~shutter/shutter/devel/view/head:/share/applications/shutter.desktop
fails the test with
```
$ desktop-file-validate s...https://standards.freedesktop.org/menu-spec/latest/apb.html allows OnlyShowIn=Unity, but
https://bazaar.launchpad.net/~shutter/shutter/devel/view/head:/share/applications/shutter.desktop
fails the test with
```
$ desktop-file-validate shutter.desktop
shutter.desktop: warning: key "OnlyShowIn" in group "Desktop Action Redo" is deprecated
shutter.desktop: warning: key "OnlyShowIn" in group "Desktop Action Select" is deprecated
shutter.desktop: warning: key "OnlyShowIn" in group "Desktop Action Screen" is deprecated
shutter.desktop: warning: key "OnlyShowIn" in group "Desktop Action Window" is deprecated
shutter.desktop: warning: key "OnlyShowIn" in group "Desktop Action Active" is deprecated
```