Pintasan desktop untuk lembar LibreCalc

Jul 04 2020

Saya baru saja meningkatkan dari 16,04 menjadi 20,04. Saya telah menggunakan Ubuntu untuk sementara waktu (jelas) tetapi sama jelasnya saya bukan guru.

Saya tidak menempatkan banyak ikon di desktop saya sehingga batasan baru GNOME dalam hal ini tidak terlalu mengkhawatirkan saya. Namun, saya memiliki dua spreadsheet yang sering saya masukkan info, jadi saya selalu meletakkan ikon untuk keduanya di desktop menggunakan tautan lunak di folder desktop. Tidak mengherankan - itu tidak lagi berhasil.

Saya telah mencoba membuat .desktopfile dengan gagasan bahwa saya dapat meletakkannya di desktop sebagai peluncur.

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.

Jawaban

1 vanadium Jul 04 2020 at 02:09

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.

Noname Jul 04 2020 at 01:24

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