Discussion:
lyx.desktop.in with absolute paths
Enrico Forestieri
2014-05-06 16:10:39 UTC
Permalink
I have problems using lyx.desktop in the existing form. Changing all paths to
absolute cures it for me, but I am unsure about the effect it may have on
autoconf build.
Also the .desktop here (on linux) has to have set the executable flag,
otherwise it is not usable.
What? .desktop files are only useful for desktop environments and
certainly they don't need to be executable.
I propose the appended changes.
Kornel
[...]
@@ -4,9 +4,9 @@ Type=Application
Name=LyX
GenericName=Document Processor
Comment=High level LaTeX frontend
StartupNotify=false
StartupWMClass=Lyx
Terminal=false
This is the most wrong thing you could do. In this way you disallow
having a script with same name early in the PATH for performing some
customization or workaround bugs/deficiencies.

Currently, without the full path in the .desktop file, when I click
on a LyX document in the GUI, this is the command that is executed:

--8<--------8<---------
$ cat ~/bin/lyx
#!/bin/sh
quoted=""
while [ $# -ne 0 ]; do
quoted="$quoted \"$1\""
shift
done
eval exec /usr/bin/lyx -geometry 910x870-4-7 $quoted
--8<--------8<---------

Using a full path in the .desktop file would upset me ;)
--
Enrico
Kornel Benko
2014-05-06 15:40:30 UTC
Permalink
I have problems using lyx.desktop in the existing form. Changing all paths to
absolute cures it for me, but I am unsure about the effect it may have on autoconf build.

Also the .desktop here (on linux) has to have set the executable flag, otherwise it
is not usable.
I propose the appended changes.

Kornel
Kornel Benko
2014-05-06 19:47:59 UTC
Permalink
I cannot get it to be shown in menu.
Most probably you have problems with the PATH used by your desktop
environment. Try removing the "TryExec=" line from the .dekstop
file and check whether that makes it appear.
It was the PATH. I added it now to ~/.pam_environment. After re-login it was
in the menu.

Thanks Enrico.

The attached is now working for me.

Kornel
Kornel Benko
2014-05-08 13:28:45 UTC
Permalink
Post by Kornel Benko
I cannot get it to be shown in menu.
Most probably you have problems with the PATH used by your desktop
environment. Try removing the "TryExec=" line from the .dekstop
file and check whether that makes it appear.
It was the PATH. I added it now to ~/.pam_environment. After re-login it was
in the menu.
Thanks Enrico.
The attached is now working for me.
I am about to commit to master.
I would also consider to commit to branch 2.1.x too if it itches some user.

Kornel

Kornel Benko
2014-05-06 16:36:47 UTC
Permalink
Post by Enrico Forestieri
I have problems using lyx.desktop in the existing form. Changing all paths to
absolute cures it for me, but I am unsure about the effect it may have on
autoconf build.
Also the .desktop here (on linux) has to have set the executable flag,
otherwise it is not usable.
What? .desktop files are only useful for desktop environments and
certainly they don't need to be executable.
I can't help. On ubuntu, if I click on it under gnome-desktop, it simply did not run.
All other .desktop files here _are_ 'executable'.
Post by Enrico Forestieri
I propose the appended changes.
Kornel
[...]
@@ -4,9 +4,9 @@ Type=Application
Name=LyX
GenericName=Document Processor
Comment=High level LaTeX frontend
StartupNotify=false
StartupWMClass=Lyx
Terminal=false
This is the most wrong thing you could do. In this way you disallow
having a script with same name early in the PATH for performing some
customization or workaround bugs/deficiencies.
Currently, without the full path in the .desktop file, when I click
--8<--------8<---------
$ cat ~/bin/lyx
#!/bin/sh
quoted=""
while [ $# -ne 0 ]; do
quoted="$quoted \"$1\""
shift
done
eval exec /usr/bin/lyx -geometry 910x870-4-7 $quoted
--8<--------8<---------
Using a full path in the .desktop file would upset me ;)
This worries me too. But even with the correct path, (which would make the .desktop file working),
the problem with the icon remains.
I simply don't know, where the icon should be installed in portable way.
(Copying e.g. to /usr/share/icons/hicolor/scalable/apps/ makes it working. But is it portable?)


Kornel
Enrico Forestieri
2014-05-06 17:24:44 UTC
Permalink
But you don't have to click those files. Rather, you should put them in
~/.local/share/applications, /usr/local/share/applications or
/usr/share/applications (precedence is from left to right)
and then maybe issue some commands. In Debian you should issue the command
update-desktop-database, so it should be the same in Ubuntu.
Just to be more explicit. Among other things, those files tell the
desktop environment whether to show an application in the menus and
in what category. They also state what mime types the application can
handle, such that it will proposed when you choose "Open with..." or
similar menu entries. There is also a mechanism to state what is
the default application (or, better, the default .desktop file) that
handles a specific mime type, and the application mentioned in that
file is run when a file with a given associated mime-type is clicked.
--
Enrico
Kornel Benko
2014-05-06 18:44:18 UTC
Permalink
Post by Enrico Forestieri
But you don't have to click those files. Rather, you should put them in
~/.local/share/applications, /usr/local/share/applications or
/usr/share/applications (precedence is from left to right)
and then maybe issue some commands. In Debian you should issue the command
update-desktop-database, so it should be the same in Ubuntu.
Yes, I can use it.
Post by Enrico Forestieri
Just to be more explicit. Among other things, those files tell the
desktop environment whether to show an application in the menus and
in what category. They also state what mime types the application can
handle, such that it will proposed when you choose "Open with..." or
similar menu entries. There is also a mechanism to state what is
the default application (or, better, the default .desktop file) that
handles a specific mime type, and the application mentioned in that
file is run when a file with a given associated mime-type is clicked.
I cannot get it to be shown in menu.
ATM lyx2.2.desktop is in /usr/local/share/applications
Calling update-desktop-database does not change anything.
Editing the mime-type, I see the type application/x-lyx, but trying to add lyx2.2
I have to use the file-manager because there is no sign of lyx in the offered menu.

Kornel
Enrico Forestieri
2014-05-06 19:35:23 UTC
Permalink
I cannot get it to be shown in menu.
Most probably you have problems with the PATH used by your desktop
environment. Try removing the "TryExec=" line from the .dekstop
file and check whether that makes it appear.
--
Enrico
Jürgen Spitzmüller
2014-05-06 16:55:08 UTC
Permalink
Post by Kornel Benko
I can't help. On ubuntu, if I click on it under gnome-desktop, it simply did not run.
On OpenSuse, with Gnome 3.12, it does.
Post by Kornel Benko
All other .desktop files here _are_ 'executable'.
They are not here (not even gnome's own).

JÃŒrgen
Kornel Benko
2014-05-06 17:14:56 UTC
Permalink
Post by Jürgen Spitzmüller
Post by Kornel Benko
I can't help. On ubuntu, if I click on it under gnome-desktop, it simply did not run.
On OpenSuse, with Gnome 3.12, it does.
Post by Kornel Benko
All other .desktop files here _are_ 'executable'.
They are not here (not even gnome's own).
You are right. Only copies in my .local directory are.
Post by Jürgen Spitzmüller
JÃŒrgen
Kornel
Enrico Forestieri
2014-05-06 17:13:20 UTC
Permalink
Post by Kornel Benko
Post by Enrico Forestieri
I have problems using lyx.desktop in the existing form. Changing all
paths to absolute cures it for me, but I am unsure about the effect it
may have on autoconf build.
Also the .desktop here (on linux) has to have set the executable flag,
otherwise it is not usable.
What? .desktop files are only useful for desktop environments and
certainly they don't need to be executable.
I can't help. On ubuntu, if I click on it under gnome-desktop, it simply did not run.
All other .desktop files here _are_ 'executable'.
But you don't have to click those files. Rather, you should put them in
~/.local/share/applications, /usr/local/share/applications or
/usr/share/applications (precedence is from left to right)
and then maybe issue some commands. In Debian you should issue the command
update-desktop-database, so it should be the same in Ubuntu.
Post by Kornel Benko
Post by Enrico Forestieri
I propose the appended changes.
Kornel
[...]
@@ -4,9 +4,9 @@ Type=Application
Name=LyX
GenericName=Document Processor
Comment=High level LaTeX frontend
StartupNotify=false
StartupWMClass=Lyx
Terminal=false
This is the most wrong thing you could do. In this way you disallow
having a script with same name early in the PATH for performing some
customization or workaround bugs/deficiencies.
Currently, without the full path in the .desktop file, when I click
--8<--------8<---------
$ cat ~/bin/lyx
#!/bin/sh
quoted=""
while [ $# -ne 0 ]; do
quoted="$quoted \"$1\""
shift
done
eval exec /usr/bin/lyx -geometry 910x870-4-7 $quoted
--8<--------8<---------
Using a full path in the .desktop file would upset me ;)
This worries me too. But even with the correct path, (which would make the
.desktop file working), the problem with the icon remains.
I simply don't know, where the icon should be installed in portable way.
(Copying e.g. to /usr/share/icons/hicolor/scalable/apps/ makes it working.
But is it portable?)
I think there is no standard in the strict sense, but the directions here:
http://freedesktop.org/wiki/Specifications/
seem to be followed.

Same story for the icon. If you use an absolute path, you prevent
customization. Maybe you should have a look at
http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
--
Enrico
Loading...