如何在 Ubuntu 13.04 上修改 Libre Office 启动器的图标右键菜单?

如何在 Ubuntu 13.04 上修改 Libre Office 启动器的图标右键菜单?

右键单击 Libre Office Unity 启动器图标时仅显示两项:打开 Libre Office 本身(即其主菜单)或从启动器中取消固定图标。

我希望 Unity 栏中的 Libre Office 图标在右键单击时显示几个选项,例如“打开写入”、“打开计算”等,类似于文件启动器图标,允许右键单击打开各种文件夹。

是否可以修改 Libre Office Unity 启动器的右键菜单以列出所有办公应用程序?

编辑:感谢@user852994 提供的帮助,尤其是这个链接至 Ubuntu 文档我最终设法拼凑出在 13.04 上适合我的启动器代码:

[Desktop Entry]
Version=1.0
Terminal=false
Icon=libreoffice-startcenter
Type=Application
Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Other;
Exec=libreoffice %U
MimeType=application/vnd.openofficeorg.extension;
Name=LibreOffice
GenericName=Office
Comment=Edit/Create documents

Actions=Writer;Calc;Impress;Draw

[Desktop Action Writer]
Name=Writer
Exec=libreoffice --writer %U
OnlyShowIn=Unity;

[Desktop Action Calc]
Name=Calc
Exec=libreoffice --calc %U
OnlyShowIn=Unity;

[Desktop Action Impress]
Name=Impress
Exec=libreoffice --impress %U
OnlyShowIn=Unity;

[Desktop Action Draw]
Name=Draw
Exec=libreoffice --draw %U
OnlyShowIn=Unity;

答案1

正如所述这里,您可以编辑桌面文件,它位于此处:/usr/share/applications/libreoffice-startcenter.desktop(从 Ubuntu 12.04 开始,否则请在该文件夹中查找 LibreOffice 快捷方式)。将该文件复制到〜/ .local /共享/应用程序/并按照之前提到过的文章添加一些[桌面操作 %younameit]部分,所以最后它可能看起来像这样:

#
# 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-startcenter
Type=Application
Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Other;
Exec=libreoffice %U
MimeType=application/vnd.openofficeorg.extension;
Name=LibreOffice
GenericName=Office
GenericName[ne]=वर्ड प्रोसेसर (...)

Actions=Writer;Calc;

[Desktop Action Writer]
Exec=libreoffice --writer %U
Name=LibreOffice Writer
OnlyShowIn=Unity;

[Desktop Action Calc]
Exec=libreoffice --calc %U
Name=LibreOffice Writer
OnlyShowIn=Unity;

相关内容