-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We should make all .desktop files executable #107826
Comments
I did already add the path to my
|
hmm actually the problem seems to be more than "make them executable". I noticed that firefox.desktop also don't use absolute path (btw I'm using
But I tried to patch thunderbird to be as close to that as possible and it still won't work 🤔 : $ git diff
diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix
index b1905359..3a52613e 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix
@@ -147,12 +147,13 @@ stdenv.mkDerivation {
cat > $out/share/applications/thunderbird.desktop <<EOF
[Desktop Entry]
Type=Application
- Exec=$out/bin/thunderbird
+ Exec=thunderbird %U
Icon=$out/usr/lib/thunderbird-bin-${version}/chrome/icons/default/default256.png
Name=Thunderbird
GenericName=Mail Reader
Categories=Application;Network;
EOF
+ chmod a+x $out/share/applications/thunderbird.desktop
# SNAP_NAME: https://github.com/NixOS/nixpkgs/pull/61980
# MOZ_LEGACY_PROFILES and MOZ_ALLOW_DOWNGRADE: |
cc @ttuegel |
FWIW, I think the note about absolute paths in the |
If
|
Regarding the absolute path in
|
So we shouldn't make them executable, and also not absolute. Let's close this then, thanks for the pointers :-) |
For the sake of completeness, this StackeExchange post also makes a few good points regarding this topic, where I believe the most significant one is: If a |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/kde-desktop-files-on-ubuntu/7724/6 |
Describe the bug
Without making .desktop files executable, KDE/Plasma blocks the running of them for security reasons.
I'm using nixpkgs with Debian+KDE, I used nixpkgs to install 3 packages with .desktop files:
Among them, only the firefox one is executable:
The other 2 are not:
I have no problem running firefox from KDE's launcher feature (I think that's called KRun), but when I try to run the other 2 KDE would complain (the screenshots are taking darktable as an example):
Searching the error message in KDE code, I found 2 occurrences of them:
https://github.com/KDE/kio/blob/6d98246cb1bdfdb5b39388c069ded589fa2db0b1/src/gui/applicationlauncherjob.cpp#L138-L155
https://github.com/KDE/kdelibs/blob/1c5b25966136b6099665477616fb4d38a98fd7ef/kio/kio/krun.cpp#L963-L978
Looking at the code, my understanding is that because the
Exec
line inside the.desktop
files are on absolute path:KDE's security policy dictates that the
.desktop
file must also be executable or it refuses to run it.As a result, I think we should make all
.desktop
files executable to improve KDE compatibility.To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Maintainer information:
The text was updated successfully, but these errors were encountered: