问题描述
是否可以在单个 Unity 图标/按钮中 ‘enclose’ 多个应用程序?为了控制启动器上的按钮数量,将一些相同类型的应用程序(例如,截图或 Web 应用程序等小型附件应用程序)存储在一个按钮中对我来说非常有用使用 xfce 面板…
最佳回答
Overview
这个答案给出了两个可能的答案——抽屉和快速列表
Drawers
抽屉可通过 12.04 的 PPA 获得:
sudo add-apt-repository ppa:ian-berke/ppa-drawers
sudo apt-get update
sudo apt-get install drawers
从 Dash 启动抽屉。对于您的抽屉,从 ~/.local/share/applications
拖放创建的图标。
启动您的抽屉 – 然后您可以将您喜欢的应用程序从 Dash 拖放到抽屉中。
图形快速列表
启动多个选项的默认统一方法是使用快速列表 – 右键单击启动器图标以显示该启动器图标的选项菜单。
使用 MyUnity 可以使用 12.04 的图形方法创建快速列表
myunity
此选项允许您创建快速列表 – 快速列表是在您右键单击启动器图标时显示的子菜单。
11.04 使用图形方法创建快速列表是 work-in-progress – 例如 – Unity Launcher Editor
这在 Natty (ubuntu 11.04) 中有效-但由于 python 版本更改,在 oneiric (ubuntu 11.10) 中不起作用(在撰写本文时)
安装
cd ~/Downloads
sudo apt-get install bzr
bzr branch lp:unity-launcher-editor
跑步
cd ~/Downloads/unity-launcher-editor
./ule
手动创建快速列表
幸运的是,手动创建快速列表也很简单。快速列表是一个 .desktop 文件,至少包含以下内容:
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon=adressbook
Name=Sample Menu
Exec=example_application1
X-Ayatana-Desktop-Shortcuts=example_app2;
[example_apps Shortcut Group]
Name=Name of Application 2
Exec=example_application2
TargetEnvironment=Unity
让我们将其分解为您应该更改的区域(从示例的顶部到底部工作)。
-
Icon=
:这是在/usr/share/icons
中找到的图形图片文件 -
Name=
:这是您将鼠标悬停在启动器图标上时看到的工具提示 -
Exec=
:这是您左键单击启动器图标时运行的默认可执行文件 -
X-Ayatana-Desktop-Shortcuts=
:这是一个 semi-colon 分隔的组列表。
每个组是条目 [group_name Shortcut Group]
下的 quick-list 菜单选项
-
example_apps
这是X-Ayatana-Desktop-Shortcuts
字段中组的名称 -
Name=
:这是快速列表菜单文本 -
Exec=
:这是选择快速列表条目时运行的可执行文件
.desktop 文件应存在于本地文件夹 ~/.local/share/applications
如果它尚不存在,请创建此文件夹:
mkdir -p ~/.local/share/applications
在文件夹中创建一个文件——例如 myquicklist.desktop 和 drag-and-drop 这个文件从 Nautilus 进入 Unity Launcher。
模仿 XFCE 启动器
单击启动器按钮时的默认 XFCE 操作是运行可执行文件。对于我们的启动器,您可以默认使用计算器
Name=My Quicklist
Exec=gcalctool
XFCE 启动器中可能的其他操作是仅显示启动器项目列表。不幸的是,在 Unity 中你不能这样做 – 它必须是右键单击。
默认的 Exec=
必须运行一些东西 – 例如,您可以使用它来显示一个快速弹出对话框,提醒您右键单击:
Name=My Quicklist
Exec=zenity --title="action" --info --text="Right-Click for quicklist" --height=50 --width=275 --timeout=2
例子
您提供了以下您想要的示例:
-
截图:
Exec=gnome-screenshot -i
-
字典:
Exec=xfce4-dict
-
计算器:
Exec=gcalctool
因此,您的示例 .desktop 文件将如下所示:
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon=addressbook
Name=My Quicklist
Exec=zenity --title="action" --info --text="Right-Click for quicklist" --height=50 --width=275 --timeout=2
X-Ayatana-Desktop-Shortcuts=screenshot;dictionary;calculator
[screenshot Shortcut Group]
Name=Gnome Screenshot
Exec=gnome-screenshot -i
TargetEnvironment=Unity
[dictionary Shortcut Group]
Name=XFCE Dictionary
Exec=xfce4-dict
TargetEnvironment=Unity
[calculator Shortcut Group]
Name=Gnome Calculator
Exec=gcalctool
TargetEnvironment=Unity
次佳回答
是的,您可以使用启动器快速列表将应用程序添加到启动器图标的右键菜单中。看这个问题:
具体来说,libreoffice example 可以修改为在同一图标下运行您想要的任何应用程序。
第三种回答
适用于 Ubuntu 11.10 (Oneiric) 和 Unity (3D)
示例:”Ubuntu Toolbox” multi-purpose 图标
描述:一个 ‘toolbox’ 图标,替换多个 Unity 启动器图标,用于:系统设置(默认)、Ubuntu Tweak、Ubuntu 软件中心和软件更新。
评论:我确实在图标(不是自定义)、文件命名和默认项上做出了一些妥协。其他替代方案可能会发生冲突或与现有项目混淆。 (被警告)
mkdir ~/.local/share/applications (if required)
gedit ~/.local/share/applications/toolbox.desktop &
注意:与号 ‘&’ 会立即释放命令行。
我的自定义 ‘toolbox.desktop’ 文件:(可以轻松编辑)
[Desktop Entry]
Name=Ubuntu Toolbox
Comment=System Settings
Exec=gnome-control-center --overview
Icon=redhat-tools
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;System;
OnlyShowIn=GNOME;Unity;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-control-center
X-GNOME-Bugzilla-Component=shell
X-GNOME-Bugzilla-Version=3.2.1
X-Ubuntu-Gettext-Domain=gnome-control-center-2.0
X-Ayatana-Desktop-Shortcuts=UbuntuTweak;SoftwareCenter;SoftwareUpdates;
[UbuntuTweak Shortcut Group]
Name=Ubuntu Tweak
Exec=ubuntu-tweak
TargetEnvironment=Unity
[SoftwareCenter Shortcut Group]
Name=Ubuntu Software Center
Exec=software-center
TargetEnvironment=Unity
[SoftwareUpdates Shortcut Group]
Name=Update Manager
Exec=update-manager -c
TargetEnvironment=Unity
第四种回答
抽屉是在 Unity Laucher 中对应用程序进行分组的完美方式。
截至目前,它在 repos 中不可用,但您仍然可以从 ppa 安装它。
sudo add-apt-repository ppa:ian-berke/ppa-drawers
sudo apt-get update
sudo apt-get install drawers
一些屏幕截图显示抽屉的使用
创建新抽屉后,您可以拖动 &从 Dash 中删除应用程序。
您甚至可以将文件和文件夹存储在抽屉中,从而提供一种快速访问常用文件的方法。
来源:http://maketecheasier.com/group-apps-together-in-unity-launcher/2012/08/10 http://www.iloveubuntu.net/how-easily-group-items-featuring-their-own-mini-dash-unity-launcher-drawers
第五种回答
我认为 david6 和fossfreedom 的答案非常好,这只是为了向您展示相同的变体。
在这种情况下,它是一个用于各种操作的 ‘Utility’ 图标,它使用标准应用程序、一些 shell 脚本和命令。因为我最常使用突触,所以我将左键单击图标设置为运行突触,其他一切都在右键单击快速列表中。
另一个兴趣点 – 在带有快速列表的自定义 .desktops 中,’X-Ayatana-Desktop-Shortcuts=’ 行决定了快速列表中显示的内容和显示的顺序。
前任。 – 您可以有 10 个 [whatever Shortcut Group] 条目,但仅通过 ‘X-Ayatana-Desktop-Shortcuts=’ 行中的内容显示其中一些
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=synaptic-pkexec
Name=Utilities
Icon=/usr/share/icons/Humanity/categories/48/applications-other.svg
X-Ayatana-Desktop-Shortcuts=UpdateManager;CompizConfig;Htop;GetUpdates;NautilusActions;DconfEditor;GconfEditor;ForceQuit;ScreenShot;SeachFiles;Gksu;
[UpdateManager Shortcut Group]
Name=Update Manager
Exec=/usr/bin/update-manager
TargetEnvironment=Unity
[Htop Shortcut Group]
Name=Htop
Exec=htop1
TargetEnvironment=Unity
[GetUpdates Shortcut Group]
Name=Update Sources
Exec=update1
TargetEnvironment=Unity
[NautilusActions Shortcut Group]
Name=Nautilus Actions
Exec=nautilus-actions-config-tool
TargetEnvironment=Unity
[CompizConfig Shortcut Group]
Name=Compiz Settings
Exec=ccsm
TargetEnvironment=Unity
[GconfEditor Shortcut Group]
Name=Gconf Editor
Exec=gconf-editor
TargetEnvironment=Unity
[ForceQuit Shortcut Group]
Name=Force Quit
Exec=xkill
TargetEnvironment=Unity
[ScreenShot Shortcut Group]
Name=Screen Shots
Exec=gnome-screenshot --interactive
TargetEnvironment=Unity
[SeachFiles Shortcut Group]
Name=Search For Files
Exec=gnome-search-tool
TargetEnvironment=Unity
[DconfEditor Shortcut Group]
Name=Dconf Editor
Exec=dconf-editor
TargetEnvironment=Unity
[Gksu Shortcut Group]
Name=Root Nautilus
Exec=gksudo nautilus
TargetEnvironment=Unity
给前。的小脚本, Exec=htop1 只是一个名为 htop1 的文件在我的 $PATH (~/bin
#!/bin/bash
gnome-terminal --command htop
Exec=update1 是一个名为 update1
#!/bin/bash
gnome-terminal --command "sudo apt-get update"
在具有大量快速列表的 .desktop 中,如果想在 X-Ayatana-Desktop-Shortcuts= 行上节省空间,您可以使用 Scg1;Scg2;Scg3; 之类的更简单的方式命名快捷方式组。等等,所以
X-Ayatana-Desktop-快捷方式=Scg1;Scg2;Scg3;等等。
以我的第一个条目为例
[Scg1 Shortcut Group]
Name=Update Manager
Exec=/usr/bin/update-manager
TargetEnvironment=Unity
很多东西&您可以如何使用启动器图标、快速列表等的各种变化,