Closed phoerious closed 5 years ago
Not sure about the status of kdialog - it seems to be missing even from KDE-centric distributions like KDE neon, because it has not been ported to KF5. At least that was the status when I last asked. So I think it is more or less a legacy fallback?
I have it on my system (Arch Linux) and would much prefer it over clunky zenity. I don't think it would be an issue to check for it first. Of course, the success rate of matching the more generic options is always higher, but then you also want to reach a certain amount of platform integration and should therefore match the more specific options first (IMHO).
Perhaps we could make use of environment variables to determine the order? So, if the sessiontype is KDE and kdialog os available, use it as the first choice?
On Ubuntu 14.04:
$ echo $SESSIONTYPE
gnome-session
$ echo $XDG_CURRENT_DESKTOP
Unity
$ echo $DESKTOP_SESSION
ubuntu
What is yours? Seems not so straightforward...
I don't think that variable exists everywhere. At least on my system, it isn't defined.
What I have is:
KDE_FULL_SESSION=true
KDE_SESSION_VERSION=5
XDG_CURRENT_DESKTOP=KDE
XDG_SESSION_DESKTOP=KDE
Check all of the envs mentioned above, I updated the post above.
I updated mine, too. :-)
Additionally to those mentioned above I also have
DESKTOP_SESSION=/usr/share/xsessions/plasma
Perhaps "if [ env | grep KDE_ ] ; then if kdialog is on the $PATH; then ..."?
You can test if the command exists anywhere in the $PATH with
command -v kdialog > /dev/null
Returns a non-zero exit code when it isn't.
env | grep KDE
is quite unsafe I think, but it may work.
Will think about it; in the meantime feel free to change the desktopintegration script for your AppImage.
Thanks! I don't think the issue is very critical, by it would be nicer to have a more native dialog.
Writing your own tiny dialog programs instead of relying on zenity & co being present might be an option. A fallback dialog tool using FLTK might also be a solution (as I suggested here).
For better KDE detection you could take a look at screenFetch or similar tools. But I think checking for the environment variable KDE_FULL_SESSION
should normally be enough.
Would accept a PR if it would come fully tested on KDE, GNOME, XFCE, Mate, Elementary, etc.
Desktop integration scripts are no longer used. The issue will be closed, please reopen it if something else comes up.
The desktop integration script looks for the availability of zenity, kdialog and Xdialog in this order for displaying its prompts.
Having Xdialog as the last fallback appears to be a sensible decision, but kdialog should come before zenity as it is specific to the KDE platform, therefore likely to be only installed when KDE is installed and in that case also the preferred choice.
On my system (Arch Linux), zenity comes as a mandatory dependency for steam, although I run KDE. The desktop integration plugin therefore always uses zenity which doesn't integrate too well with the rest of the desktop. It would be great if kdialog would have higher priority.