Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rpm installing an icon to the desktop

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}
like image 826
jedierikb Avatar asked Jan 31 '11 21:01

jedierikb


People also ask

How do I put GNOME icon on desktop?

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 .

How do I put icons on my desktop in Fedora?

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.

How do I restore desktop icons in Linux?

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.


1 Answers

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.

EDIT:

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.

like image 97
ninjalj Avatar answered Sep 22 '22 23:09

ninjalj