1

I recently upgraded from 16.04 to 20.04. I've been using Ubuntu for a while (obviously) but just as obviously I am no guru.

I don't place many icons on my desktop so the new limitations of GNOME in this regard didn't worry me too much. I do, however, have two spreadsheets that I enter info frequently into, so I've always put icons for these two on the desktop using soft links in the desktop folder. No surprise - that no longer works.

I've tried to create a .desktop file with the idea that I could put it on the desktop as a launcher.

I created this ePayments.desktop in ~/.local/share/applications and it appears in Show Applications. When I click on it, LibreOffice starts to open but I only get an error that says:

/Bookkeeping/2020ePayments.ods does not exist

Here is the content of my ePayments.desktop file:

[Desktop Entry]
Name=ePayments spreadsheet
Exec=xdg-open /mnt/Data/Bookkeeping/2020ePayments.ods
Comment=Open ePayments spreadsheet
Terminal=false
Type=Application
Icon=x-office-spreadsheet
$ ls -l /mnt/Data/Bookkeeping
-rwx------  1 brent brent 96249 Jul  3 09:25 2020ePayments.ods

Thanks for any assistance!

Update

Eliah -

I inserted parameters from the file that you posted. The resulting .desktop file is:

[Desktop Entry]  
Name=ePayments spreadsheet  
Exec=libreoffice --calc %U  
Comment=Open ePayments spreadsheet  
Terminal=false  
Type=Application  
Icon=libreoffice-calc  
StartupNotify=true  
X-GIO-NoFuse=true  

I still get the same error message. Did I miss the point?


Solution from below.

Replace the Exec= statement in the .desktop file above with:

Exec=xdg-open /mnt/Data/Bookkeeping/2020ePayments.ods

Note that the Exec= statement was in my original .desktop file so one of the statements I added after Eliah's advice must have changed something.

2 Answers 2

1

In your case, the approach with a softlink is much quicker and obvious than working with a .desktop file.

Symlinks

Soft links on the desktop do work in Ubuntu 20.04. Perhaps your issue was in creating the soft link on the desktop?

Indeed, that will not work anymore using Ctrl+Shift and dragging, or dragging a soft link from Files to the desktop. Use one of the following methods to create a softlink on the desktop:

  • Create your softlinks in the folder "Desktop" in a Files window. Every file you place there will appear on the desktop. Your softlinks will work: you will be able to double click the icon on the desktop to launch the spreadsheet.
  • Alternatively, create the softlink from the right-click menu of the file. In order to have that option, you need to enable it in Preferences, Behavior tab: check "Show action to create symbolic links". After creation, hit Ctrl+x, then right-click the desktop and select "Paste".

.desktop launcher

Your .desktop file is correct and should work if Libreoffice has access to the mounted drive. Perhaps you are running the Snap version of Libreoffice. If that is the case, you will need to enable that by connecting Libreoffice to the removable-media interface.

Starred files

A new feature that would very well fit your user case, is the "Starred files" feature. After starring, they appear in the Starred folder in Files.

6
  • I tried this first, since that is how I was doing it before. When I double-click on the desktop link I get the error message "Execution of home/brent/desktop/Link to 2020ePayments.ods. Command not found."
    – UberNoob
    Jul 3, 2020 at 23:36
  • Strange, I cannot reproduce this. It works for me.
    – vanadium
    Jul 4, 2020 at 11:04
  • I appreciate the followup, vanadium. I followed the link but received a message that no plug exists. Further research indicated that this plug may be automatically installed (snapcraft.io/docs/removable-media-interface). I'm using LO 6.4.3.2 and I can open the file in Calc by click on the file or by opening Calc and navigating to the file. Doesn't that confirm that LO can access the file on the mounted drive?
    – UberNoob
    Jul 4, 2020 at 11:16
  • The command which libreoffice will confirm whether you are running the snap version or the regular APT version of libreoffice. The version numbers suggests to me that it will be the current, regular version. And indeed, if you can access it otherwise, then that is not the issue.
    – vanadium
    Jul 4, 2020 at 11:19
  • 1
    Does it work if you enter the command xdg-open /mnt/Data/Bookkeeping/2020ePayments.ods directly in the terminal?
    – vanadium
    Jul 4, 2020 at 11:29
0

I have installed LibreOffice from the official repo. I use CentOS, but I think it is the same in Ubuntu too. You can simply copy /usr/share/applications/libreoffice-calc.desktop file to the ~/.local/share/applications folder, so that this icon is available on your desktop.

Here is the content of libreoffice-calc.desktop (trimmed up a little):

# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
#   Licensed to the Apache Software Foundation (ASF) under one or more
#   contributor license agreements. See the NOTICE file distributed
#   with this work for additional information regarding copyright
#   ownership. The ASF licenses this file to you under the Apache
#   License, Version 2.0 (the "License"); you may not use this file
#   except in compliance with the License. You may obtain a copy of
#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
[Desktop Entry]
Version=1.0
Terminal=false
Icon=libreoffice-calc
Type=Application
Categories=Office;Spreadsheet;X-Red-Hat-Base;X-MandrivaLinux-Office-Spreadsheets;
Exec=libreoffice --calc %U
MimeType=application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.spreadsheet-template;application/vnd.sun.xml.calc;application/vnd.sun.xml.calc.template;application/msexcel;application/vnd.ms-excel;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-excel.sheet.macroEnabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroEnabled.12;application/vnd.ms-excel.sheet.binary.macroEnabled.12;text/csv;application/x-dbf;text/spreadsheet;application/csv;application/excel;application/tab-separated-values;application/vnd.lotus-1-2-3;application/vnd.oasis.opendocument.chart;application/vnd.oasis.opendocument.chart-template;application/x-dbase;application/x-dos_ms_excel;application/x-excel;application/x-msexcel;application/x-ms-excel;application/x-quattropro;application/x-123;text/comma-separated-values;text/tab-separated-values;text/x-comma-separated-values;text/x-csv;application/vnd.oasis.opendocument.spreadsheet-flat-xml;application/vnd.ms-works;application/clarisworks;application/x-iwork-numbers-sffnumbers;application/x-starcalc;
Name=LibreOffice Calc
GenericName=Spreadsheet
GenericName[ru]=Электронная таблица
Comment=Perform calculations, analyze information and manage lists in spreadsheets by using Calc.
Comment[ru]=Выполнение вычислений, анализ информации и управление списками в электронных таблицах с помощью Calc.
StartupNotify=true
X-GIO-NoFuse=true
Keywords=Accounting;Stats;OpenDocument Spreadsheet;Chart;Microsoft Excel;Microsoft Works;OpenOffice Calc;ods;xls;xlsx;
InitialPreference=5
StartupWMClass=libreoffice-calc
X-KDE-Protocols=file,http,ftp,webdav
X-TryExec=oocalc

Actions=NewDocument;
[Desktop Action NewDocument]
Name=New Spreadsheet
Name[ru]=Создать эл.таблицу
Exec=libreoffice --calc
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .