In Fedora Gnome...
Using a .desktop file in my rpm, I have successfully put my gui software into the gnome application menu.
I am wondering if there is a way to also put the icon onto the gnome desktop when installing the rpm?
update:
Now I can get rpmbuild
to successfully use rpmbuild with xdg-desktop-icon
in %install
... and in the process puts an icon on my desktop (before even installing the rpm!) I am doing something wrong. Any suggestions?
Here is the relevant part of my spec file:
Source1: %{name}.desktop
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gettext, python-devel, desktop-file-utils, xdg-utils
...
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE1}
xdg-desktop-icon install --novendor %{SOURCE1}
Create a Desktop Shortcut on GNOME Desktop In GNOME desktop, you can use gnome-desktop-item-edit to configure a desktop shortcut easily. In this example, gnome-desktop-item-edit will automatically create a desktop launcher file in ~/. local/share/applications .
To enable desktop icons on Fedora 25, you just need to work on a X11 session. So to do that at login screen, click on the settings icon and select GNOME on Xorg. Then you need to enable the proper option on gnome-tweak-tool: go on Desktop tab and switch to ON the icons on desktop setting.
First, launch Gnome Software on your Linux PC. Then, when the app is open, click on the search button and search for “Desktop Icons.” Click on the search result that says “Desktop Icons” with the puzzle icon to go to its extension page in Gnome Software.
The page you linked to explains how to use desktop-file-install
on the %install
section of your SPECS
. Apart from that, you may need to use xdg-desktop-icon
from the xdg-utils
package.
Apparently, %install
is to only be used at build time (at make install
time). For package installation and removal there's %pre
, %post
, %preun
and %postun
. It looks like you should use %post
, checking $1
as explained on https://fedoraproject.org/wiki/Packaging:ScriptletSnippets.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With