-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Fix linux desktop files validation #3817
Conversation
Thank you for the PR. I'm ok to change the quotes so that it pass validation by I suggest: diff --git a/app/data/scrcpy-console.desktop b/app/data/scrcpy-console.desktop
index 47a63ec99..f99217827 100644
--- a/app/data/scrcpy-console.desktop
+++ b/app/data/scrcpy-console.desktop
@@ -5,7 +5,7 @@ Comment=Display and control your Android device
# For some users, the PATH or ADB environment variables are set from the shell
# startup file, like .bashrc or .zshrc… Run an interactive shell to get
# environment correctly initialized.
-Exec=/bin/bash --norc --noprofile -i -c '"$SHELL" -i -c scrcpy || read -p "Press any key to quit..."'
+Exec=/bin/bash --norc --noprofile -i -c "\"\\$SHELL\" -i -c scrcpy || read -p 'Press any key to quit...'"
Icon=scrcpy
Terminal=true
Type=Application
diff --git a/app/data/scrcpy.desktop b/app/data/scrcpy.desktop
index 082b75e0f..1be86a2ba 100644
--- a/app/data/scrcpy.desktop
+++ b/app/data/scrcpy.desktop
@@ -5,7 +5,7 @@ Comment=Display and control your Android device
# For some users, the PATH or ADB environment variables are set from the shell
# startup file, like .bashrc or .zshrc… Run an interactive shell to get
# environment correctly initialized.
-Exec=/bin/sh -c '"$SHELL" -i -c scrcpy'
+Exec=/bin/sh -c "\"\\$SHELL\" -i -c scrcpy"
Icon=scrcpy
Terminal=false
Type=Application What do you think? |
Sorry for the noise, I now remember I switched back my /bin/sh to bash (from dash)... So of course using /bin/sh worked Let me update the PR restoring bash in scrcpy-console |
Follow quoting rules from: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables Fixes #3633 <#3633>
Follow quoting rules from: <https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables> PR #3817 <#3817> Fixes #3633 <#3633> Signed-off-by: Romain Vimont <[email protected]>
Thank you 👍 Rebased on |
Hi, I noticed this MR because after recent update I saw new warnings in terminal:
On a closer inspection, those lines might be valid after all, and we have a bug in KConfig parser instead. Nevertheless, these lines look a bit over-engineered, but also inconsistent at the same time. Why hardcoding /bin/sh in one .desktop file, /bin/bash in another, and then asking them to execute whatever the Besides, the whole comment indicates that it is a workaround broken user setup in the first place:
If user needs their environment variables be accessible from apps, they need to put it into appropriate .profile config. Expecting each and every app to "fix" it for them in gazzilion different creative ways isn't going to fly. |
Because in one case (
That's true, but in practice, scrcpy is a command-line app, so intended to be started from a terminal. The point of I agree that this is not pretty. In a sense, it seems that the |
Meanwhile I sent a "readability patch" to KConfig and filed a bug report about missing specialized Exec= parsing algorithm in KService/KDesktopFile. |
Just to be sure, the current version of scrcpy causes the bug in KConfig, but the previous one was working fine? |
Sure. The old variant didn't contain any escape sequences after all. |
Add an option to make scrcpy pause on exit. Three behaviors are possible: - always pause on exit: --pause-on-exit --pause-on-exit=true - never pause on exit: (no option) --pause-on-exit=false - pause when scrcpy returns with an error (a non-zero exit code): --pause-on-exit=if-error This is useful to prevent the terminal window from automatically closing, so that error messages can be read. Refs #3817 <#3817> Refs #3822 <#3822> PR #4130 <#4130>
Add an option to make scrcpy pause on exit. Three behaviors are possible: - always pause on exit: --pause-on-exit --pause-on-exit=true - never pause on exit: (no option) --pause-on-exit=false - pause when scrcpy returns with an error (a non-zero exit code): --pause-on-exit=if-error This is useful to prevent the terminal window from automatically closing, so that error messages can be read. Refs #3817 <#3817> Refs #3822 <#3822> PR #4130 <#4130>
Follow quoting rules from:
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables Also use /bin/sh for scrpy-console
This fixes #3633 #3633
Downstream Gentoo bug: https://bugs.gentoo.org/888133
It adds a few backslashes but makes desktop-file-validate happy