1

I turned the Amazon cloud reader site https://read.amazon.com into a desktop app with nativefier. It works amazingly well as a standalone reader for books that have been downloaded and also automatically downloads books in the cloud when requested.

Instead of launching /home/myname/kindle-web-linux-x64/kindle-web from the console all the time, I tried to make a Kindle-Web desktop file to place in the launcher. My file won't work in two ways:

  1. It won't launch Kindle-Web.
  2. It does not display the Kindle icon on the file when viewed in Nautilus.

The code is below. Can anyone tell me where I went wrong. The icon files are in /home/myname/.local/share/icons/hicolor/<resolution-folders>, and /home/myname/.icons/hicolor/*.

[Desktop Entry]
Version=1.0
Name=Kindle-Web
Comment=Desktop app created from Kindle Cloud Reader page (https://read.amazon.com) by nativefier
Exec=/home/myname/kindle-web-linux-x64/kindle-web
Path=/home/myname/
# StartupNotify=true
# StartupWMClass=kindle-web
Icon=0914_Kindle.0
# Terminal=false
Type=Application
Categories=Publishing;Literature;Documentation;Office;
pomsky
  • 67,112
  • 21
  • 233
  • 243
Hedley Finger
  • 928
  • 2
  • 14
  • 30
  • 1
    Is the .desktop file executable? – Xen2050 Jan 03 '19 at 08:51
  • The icon path is also incorrect. If .desktop is executable too, then what do you get when you double click on .desktop file? – Kulfy Jan 03 '19 at 09:15
  • @Kulfy The icon path is most probably not as issue provided there is actually an image file named `0914_Kindle.0` in one of the `hicolor` directories. hicolor *is* the default fallback theme for icon themes (if the icon is not found in the current icon theme, it should look into hicolor for icons). – pomsky Jan 03 '19 at 11:02
  • So does running `/home/myname/kindle-web-linux-x64/kindle-web` in Terminal launch the application? – pomsky Jan 03 '19 at 12:13
  • @pomsky But I believe this is the reason why *It does not display the Kindle icon on the file when viewed in Nautilus.* – Kulfy Jan 03 '19 at 12:27
  • @Kulfy Wrong icon specification can be a reason, but not sure if that's the reason here. File managers don't generally show the specified icon for .desktop launchers unless they're executable (see [this](https://askubuntu.com/q/1098317/480481) and [this](https://askubuntu.com/q/17220/480481) for example). OP hasn't clarified if it's executable. – pomsky Jan 03 '19 at 12:36
  • @pomsky Yeah I agree with your point. – Kulfy Jan 03 '19 at 12:40
  • @Xen2050, @pomsky, @Kulfy The `Kindle.desktop` file is executable. It is temporarily in the `~/Desktop` folder. When you double-click it, a *There was an error launching the application* alert appears. @pomsky Running `/home/myname/kindle-web-linux-x64/kindle-web` in the console does launch the Kindle Cloud Reader as a desktop app. @Kulfy Quoting you, *"there is actually an image file named `0914_Kindle.0` in one of the hicolor directories."* – Hedley Finger Jan 04 '19 at 10:29

3 Answers3

0

If running

/home/myname/kindle-web-linux-x64/kindle-web

in Terminal indeed launches the application whereas the .desktop launcher doesn't, then change the Exec line from

Exec=/home/myname/kindle-web-linux-x64/kindle-web

to

Exec=bash -c '/home/myname/kindle-web-linux-x64/kindle-web'
pomsky
  • 67,112
  • 21
  • 233
  • 243
0

Google Chrome actually has a feature to make a shortcut on desktop, which on Linux will effectively create a .desktop shortcut.

Steps to create:

  1. Open https://read.amazon.com in Google Chrome
  2. Click on the Chrome's top right menu
  3. Navigate to More tools Create a shortcut

At this point you should have the .desktop file in your home directory, which should launch a single chrome window. You can customize the resulting file if you like.

BeastOfCaerbannog
  • 12,964
  • 10
  • 49
  • 77
Sergiy Kolodyazhnyy
  • 103,293
  • 19
  • 273
  • 492
0

I will answer about my experience.

  1. First I recommend, not using "." on icon names. I am not sure why, but I had in past the same problem with a desktop file with an icon called with org.xxx.xxx style, and icon never shown in "Application Menu".

  2. I recommend that your icon have at least 128x128 version.

  3. Call the update-icon-caches

update-icon-caches ~/.local/share/icons
  1. Copy your desktop file to ~/.local/share/applications and run the update-desktop-database
update-desktop-database ~/.local/share/applications

So now, you should see the app in "Applications Menu" with correct icon displayed