可以使用哪些自定义启动器和Unity快速列表?

请注意,目前,下面包含的大部分信息已过时,无法更新。 要小心,大部分内容不适用于Ubuntu 12.04及更高版本。

为Unity创建自定义启动器很简单。 快速列表为快速访问特定应用程序的常用任务提供了一种简单有效的方法。

注意:从Ubuntu 11.10开始,此弹出选项已消失。 现在只能通过编辑主文件夹中的文本文件来创建启动器。

创建自定义启动器很简单。

  1. 右键单击桌面,然后单击“创建启动器”。
  2. 使用文本编辑器编辑.desktop文件。 (更多信息可以在这里和这里找到。)

那么,您在Unity上使用哪些自定义启动器?

注意:每个答案请限制自己使用一个自定义启动器。 另外,请提供它的实际屏幕截图。

主页图标快速列表

主页图标快速列表

  1. 将“主文件夹”启动器文件复制到您的主目录:

    mkdir ~/.local/share/applications cp /usr/share/applications/nautilus-home.desktop ~/.local/share/applications 
  2. 在gedit中打开文件进行编辑:

     gedit ~/.local/share/applications/nautilus-home.desktop 
  3. 从文件中删除以下行:

     OnlyShowIn=GNOME; 
  4. 将此文本添加到文件的底部 ,然后关闭并保存:

     X-Ayatana-Desktop-Shortcuts=Videos;Documents;Music;Pictures;Downloads [Videos Shortcut Group] Name=Videos Exec=nautilus Videos TargetEnvironment=Unity [Documents Shortcut Group] Name=Documents Exec=nautilus Documents TargetEnvironment=Unity [Music Shortcut Group] Name=Music Exec=nautilus Music TargetEnvironment=Unity [Pictures Shortcut Group] Name=Pictures Exec=nautilus Pictures TargetEnvironment=Unity [Downloads Shortcut Group] Name=Downloads Exec=nautilus Downloads TargetEnvironment=Unity 
  5. 注销并再次登录以查看更改。

资源

SSH启动器

快速访问您喜欢的SSH服务器列表。

ssh快速清单

  1. 在终端类型中使用gedit创建一个新文件:

     gedit ~/.local/share/applications/ssh-launcher.desktop 
  2. 将此文本复制并粘贴到上面的文件中:

     [桌面入口]
    版本= 1.0
     Name =远程服务器
    评论=登录我的服务器
     Exec = gnome-terminal --disable-factory --sm-client-disable --class = remoteserver -x ssh -t minibox.local 
    终端=假
     X-MultipleArgs =假
    类型=应用
    图标=公用事业末端
     StartupNotify您=真
     StartupWMClass = RemoteServers
     X-阿亚坦 - 桌面-快捷= Server1上;
    
     [Server1快捷方式组]
     Name = SSH到minibox.local
     Exec = gnome-terminal --disable-factory --sm-client-disable --class = remoteserver -x ssh -t minibox.local
     TargetEnvironment =团结
    
     Comment =您可以创建更多这些。 只需将X-Ayatana-Desktop-Shortcuts添加到“Server2”,“Server3”等,然后将域名(在本例中为“minibox.local”)更改为您的服务器名称。 您还会注意到默认操作(当您只是单击启动器中的图标时)是SSH到minibox.local  - 您需要将其更改为最常用的服务器。
    
  3. 通过导航到Nautilus中的〜/ .local / share / applications / 拖放到启动器上。

来源1 , 来源2

Ubuntu软件中心快速列表

通过软件属性UI快速添加PPA并更新源。

软件经理快速列表

  1. 使用终端将原始.desktop文件复制到您的主文件夹:

    cp /usr/share/applications/ubuntu-software-center.desktop ~/.local/share/applications/

  2. 使用gedit 打开文件进行编辑:

    gedit ~/.local/share/applications/ubuntu-software-center.desktop

  3. 在文件底部添加以下内容。 这应该在X-Ubuntu-Gettext-Domain = software-center行之后输入

 X-Ayatana-Desktop-Shortcuts=SoftwareUpdates;SoftwareProperties;Synaptic; [SoftwareUpdates Shortcut Group] Name=Update Manager Exec=update-manager -c OnlyShowIn=Unity [SoftwareProperties Shortcut Group] Name=Add/Edit PPAs Exec=gksu software-properties-gtk %u OnlyShowIn=Unity [Synaptic Shortcut Group] Name=Synaptic Software Manager Exec=gksu synaptic %u OnlyShowIn=Unity 

主页图标快速列表(从书签自动更新)

这是一个小的shell脚本,可以使用您的所有书签更新您的Home-Quicklist。 没有手动操作。 它会读取您的书签文件并从中创建菜单项。 它还添加了“Root Filemanager”菜单条目。

实施快速清单的屏幕截图

  1. 将下面列出的脚本复制到一个空文件中并将其放在scripts-folder中(我们假设它是~/bin/ ,您选择的脚本名称是unityhome.bash )。
  2. 运行一次脚本以添加条目:

     bash ~/bin/unityhome.bash 
  3. 您可以选择让cron每隔一段时间为您运行一次脚本。 要将其添加到cron,请将以下命令键入shell:

     crontab -e 

    编辑将打开。 添加一行如下:

     @reboot /bin/bash/ $HOME/bin/unityhome.bash > /dev/null 2>&1 

    如果您不执行此步骤,则每次更改nautilus书签时都必须手动运行脚本(如果要更新快速列表)。

  4. 更改仅在您下次登录或Alt + F2后生效

     unity --replace 

    那样做吧。 注意:不要在终端中运行unity --replace 如果你关闭那个终端,它会杀死它的统一。

  5. 享受并查看用于解析ssh书签的gnome-terminal的类似脚本 (在~/.ssh/config )。

脚本:

这是脚本:

 #!/bin/bash # tabsize: 4, encoding: utf8 # # © 2011 con-f-use@gmx.net. Use permitted under MIT license: # http://www.opensource.org/licenses/mit-license.php # # CONTRIBUTORS: Chris Druif  # Scott Severance  # jacopoL  # # This script updates the unity quicklist menu for nautilus to contain the user # bookmarks. The updates will have efect after unity is restarted (either on # the next login or by invoking 'unity --replace'). # location of template and unity bar launchers nautempl="/usr/share/applications/nautilus-home.desktop" target="$HOME/.local/share/applications/nautilus-home.desktop" bookmarks="$HOME/.gtk-bookmarks" # backup if file already exists if [ -e "$target" ]; then echo "Creating backup of: $target." mv -n "$target" "$target.bak" fi # copy template cp "$nautempl" "$target" if ! grep -q 'OnlyShowIn=.*Unity' "$target"; then # add only if not already present sed -i "s/\(OnlyShowIn=.*\)/\1Unity;/" "$target" fi # due to a bug in Unity (Ubuntu 11.10+) we will have to completely remove the OnlyShowIn line: # https://bugs.launchpad.net/ubuntu/+source/unity/+bug/842257/comments/6 sed -i '/^OnlyShowIn=/d' "$target" if ! grep -q 'X-Ayatana-Desktop-Shortcuts=' "$target"; then # add only if not already present echo -e "\nX-Ayatana-Desktop-Shortcuts=\n" >> "$target" else echo >> "$target" fi bmcount=0 while read bmline; do bmcount=$(($bmcount+1)) # number of current bookmark bmname=${bmline#*\ } # name of the bookmark bmpath=${bmline%%\ *} # path the bookmark leads to # deal with bookmarks that have no name if [ "$bmname" = "$bmpath" ]; then bmname=${bmpath##*/} fi # fix spaces in names and paths bmname="$(echo "$bmname" | sed 's/%20/ /g')" bmpath="$(echo "$bmpath" | sed 's/%20/ /g')" # fix accents in names and paths (for french users) bmname="$(echo "$bmname" | python -c 'import sys,urllib;sys.stdout.write(urllib.unquote(sys.stdin.read()))')" bmpath="$(echo "$bmpath" | python -c 'import sys,urllib;sys.stdout.write(urllib.unquote(sys.stdin.read()))')" # extend shortcut list with current bookmark, prepending a ; if needed sed -i "s/\(X-Ayatana-Desktop-Shortcuts=\(.*;$\|$\)\)/\1Scg${bmcount};/ t s/\(X-Ayatana-Desktop-Shortcuts=.*\)/\1;Scg${bmcount};/" "$target" # write bookmark information cat - >> "$target" <> "$target" < 

改进:不要复制“主文件夹”和“用户名”

如果您不希望有两个项目定位到您的主文件夹(快速列表底部的“主文件夹”和可点击的用户名),您可以替换以下代码:

  # write bookmark information cat - >> "$target" < 

通过以下代码:

  # write bookmark information if [ "file://$HOME" != "$bmpath" ]; then cat - >> "$target" < 

LibreOffice快速列表

这将为LibreOffice Start Center启动程序创建快速列表。

LibreOffice快速列表

  1. 将原始.desktop文件复制到主目录中进行编辑:

     cp /usr/share/applications/libreoffice-startcenter.desktop ~/.local/share/applications 
  2. 在gedit中打开:

     gedit ~/.local/share/applications/libreoffice-startcenter.desktop 
  3. 编辑MimeType行:

    找到以下行:

     MimeType=application/vnd.openofficeorg.extension; 

    替换为:

     MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/vnd.stardivision.writer;application/msword;application/vnd.ms-word;application/x-doc;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.spreadsheet-template;application/vnd.sun.xml.calc;application/vnd.sun.xml.calc.template;application/vnd.stardivision.calc;application/vnd.stardivision.chart;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;application/vnd.oasis.opendocument.graphics;application/vnd.oasis.opendocument.graphics-template;application/vnd.sun.xml.draw;application/vnd.sun.xml.draw.template;application/vnd.stardivision.draw;application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.presentation-template;application/vnd.sun.xml.impress;application/vnd.sun.xml.impress.template;application/vnd.stardivision.impress;application/mspowerpoint;application/vnd.ms-powerpoint;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.ms-powerpoint.presentation.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.ms-powerpoint.template.macroenabled.12;application/vnd.oasis.opendocument.formula;application/vnd.sun.xml.math;application/vnd.stardivision.math; 
  4. 突出显示并复制下面的文本,然后将其粘贴到.desktop文件的底部

     X-Ayatana-Desktop-Shortcuts=Writer;Impress;Calc;Math;Draw [Writer Shortcut Group] Name=Writer Exec=libreoffice -writer %U TargetEnvironment=Unity [Impress Shortcut Group] Name=Impress Exec=libreoffice -impress %U TargetEnvironment=Unity [Calc Shortcut Group] Name=Calc Exec=libreoffice -calc %U TargetEnvironment=Unity [Math Shortcut Group] Name=Math Exec=libreoffice -math %U TargetEnvironment=Unity [Draw Shortcut Group] Name=Draw Exec=libreoffice -draw %U TargetEnvironment=Unity 

    注意对于LibreOffice 3.4和3.4.1:在Exec中; libreoffice必须替换为`libreoffice3.4’,但在Oneiric中似乎我们不需要添加版本号。 我正在从Oneiric测试它并保持默认运行良好,添加verison编号使快速列表无法使用

  5. 导航到〜/ .local / share / applications并将LibreOffice Start Center桌面文件拖放到启动器上。

可以对LibreOffice Writer启动器进行类似的修改。

资源

终端快速清单

终端img(更新)

  1. 使用终端 原始终端启动器复制到您的主目录:

     cp /usr/share/applications/gnome-terminal.desktop ~/.local/share/applications 
  2. 使用终端使用gedit 打开文件

     gedit ~/.local/share/applications/gnome-terminal.desktop 
  3. 从文件中找到以下行:

     OnlyShowIn=GNOME; 

    以上行替换为:

     OnlyShowIn=GNOME;Unity; 
  4. 将此文本添加到文件的底部 ,然后保存并关闭它:

     X-Ayatana-Desktop-Shortcuts=NewWindow;NewTab;Top;Root; [NewWindow Shortcut Group] Name=New Window Exec=gnome-terminal --window TargetEnvironment=Unity [NewTab Shortcut Group] Name=New Tab Exec=xdotool windowfocus gnome-terminal key ctrl+shift+t TargetEnvironment=Unity [Root Shortcut Group] Name=Root Terminal Exec=gksudo gnome-terminal TargetEnvironment=Unity [Top Shortcut Group] Name=Top Exec=gnome-terminal --command top TargetEnvironment=Unity 
  5. 要启用“新标签”选项,您需要安装xdotool 安装xdotool 来自Ubuntu软件中心

  6. 关闭所有终端窗口,右键单击其启动器图标并取消选中“Keep In Launcher”

  7. 打开Dash,运行Terminal ,将出现带有快速列表的新启动器。

Firefox快速列表

向启动器添加方便的Firefox选项。

在此处输入图像描述

  1. 原始.desktop文件复制到主目录中进行编辑:

     cp /usr/share/applications/firefox.desktop ~/.local/share/applications 
  2. 在gedit中打开

     gedit ~/.local/share/applications/firefox.desktop 
  3. 查找并编辑以下行:

     X-Ayatana-Desktop-Shortcuts=NewWindow; 

    匹配这一行:

     X-Ayatana-Desktop-Shortcuts=NewWindow;SafeMode;ProfileManager; 
  4. 将此文本添加到.desktop的底部 ,然后保存文件:

     [SafeMode Shortcut Group] Name=Open Firefox in safe mode Exec=firefox -safe-mode TargetEnvironment=Unity [ProfileManager Shortcut Group] Name=Firefox Profile Manager Exec=firefox -ProfileManager TargetEnvironment=Unity 

Google服务启动器

用于常用服务的自定义启动器,如gmail,日历,撰写新邮件。

在此处输入图像描述

  1. 通过打开文本编辑器创建一个新文件 ,并将以下文本粘贴到其中:

     [Desktop Entry] Version=1.0 Name=Google Services Exec=xdg-open https://accounts.google.com/ Terminal=false X-MultipleArgs=false Type=Application Icon=chrome-https___docs.google.com_ Categories=Network;WebBrowser; StartupNotify=true StartupWMClass=docs.google.com X-Ayatana-Desktop-Shortcuts=Plus;Inbox;Compose;Voice;Contacts;Calendar;Documents;Photos;Maps;Sites;Reader;Bookmarks Name[en_US]=Google Services (Gmail) [Plus Shortcut Group] Name=Plus Exec=xdg-open 'https://plus.google.com/u/0/' TargetEnvironment=Unity [Inbox Shortcut Group] Name=InBox Exec=xdg-open 'https://mail.google.com/mail/u/0/?shva=1#inbox' TargetEnvironment=Unity [Compose Shortcut Group] Name=Compose Exec=xdg-open 'https://mail.google.com/mail/?shva=1#compose' TargetEnvironment=Unity [Voice Shortcut Group] Name=Voice Exec=xdg-open 'https://www.google.com/voice/b/0?pli=1#inbox' TargetEnvironment=Unity [Contacts Shortcut Group] Name=Contacts Exec=xdg-open 'https://www.google.com/contacts' TargetEnvironment=Unity [Calendar Shortcut Group] Name=Calendar Exec=xdg-open 'https://calendar.google.com' TargetEnvironment=Unity [Documents Shortcut Group] Name=Documents Exec=xdg-open https://docs.google.com/ TargetEnvironment=Unity [Photos Shortcut Group] Name=Photos Exec=xdg-open 'https://plus.google.com/u/0/photos' TargetEnvironment=Unity [Maps Shortcut Group] Name=Maps Exec=xdg-open 'http://maps.google.com/maps?hl=en&tab=ml' TargetEnvironment=Unity [Sites Shortcut Group] Name=Sites Exec=xdg-open 'https://sites.google.com/?tab=m3&pli=1' TargetEnvironment=Unity [Reader Shortcut Group] Name=Reader Exec=xdg-open 'https://www.google.com/reader/view/?hl=en&tab=my' TargetEnvironment=Unity [Bookmarks Shortcut Group] Name=Bookmarks Exec=xdg-open 'https://www.google.com/bookmarks/l' TargetEnvironment=Unity 
  2. 使用此文件夹位置和名称保存文件

      ~/.local/share/applications/google-services-launcher.desktop 
  3. 通过导航到文件管理器中的~/.local/share/applications/ ,将此文件拖放到启动器上。

您可以在此处下载图标。

资源

Banshee快速列表

女妖快速清单

  1. 将Banshee启动器复制到您的主目录,在终端粘贴以下内容:

     cp /usr/share/applications/banshee.desktop ~/.local/share/applications 
  2. 打开此新文件进行编辑:

     gedit ~/.local/share/applications/banshee.desktop 
  3. 突出显示并复制下面的文本,然后将其粘贴到文件的底部

     X-Ayatana-Desktop-Shortcuts=Play;Pause;Stop;Previous;Next;Preferences [Play Shortcut Group] Name=Play Exec=banshee --play TargetEnvironment=Unity [Pause Shortcut Group] Name=Pause Exec=banshee --pause TargetEnvironment=Unity [Stop Shortcut Group] Name=Stop Exec=banshee --stop TargetEnvironment=Unity [Previous Shortcut Group] Name=Previous Exec=banshee --previous TargetEnvironment=Unity [Next Shortcut Group] Name=Next Exec=banshee --next TargetEnvironment=Unity [Preferences Shortcut Group] Name=Preferences Exec=banshee --show-preferences TargetEnviroment=Unity 

资料来源: 1,2

Google文档快速列表

在此处输入图像描述

  1. 使用以下命令创建新文件:

     gedit ~/.local/share/applications/gdocs.desktop 
  2. 粘贴在下面的文字中:

     [Desktop Entry] Version=1.0 Name=Google Docs Exec=xdg-open https://docs.google.com/ Terminal=false X-MultipleArgs=false Type=Application Icon=chrome-https___docs.google.com_ Categories=Network;WebBrowser; StartupNotify=true StartupWMClass=docs.google.com X-Ayatana-Desktop-Shortcuts=Doc;Spreadsheet;Presentation;Drawing [Doc Shortcut Group] Name=New Document Exec=xdg-open https://docs.google.com/?action=newdoc TargetEnvironment=Unity [Spreadsheet Shortcut Group] Name=New Spreadsheet Exec=xdg-open https://spreadsheets.google.com/ccc?new TargetEnvironment=Unity [Presentation Shortcut Group] Name=New Presentation Exec=xdg-open https://docs.google.com/?action=new_presentation TargetEnvironment=Unity [Drawing Shortcut Group] Name=New Drawing Exec=xdg-open https://docs.google.com/drawings/create?hl=en TargetEnvironment=Unity 

    请注意,这将在您的默认浏览器中打开。 对于chrome / ium全屏应用,请使用chrome chromium-browserhttps: with --app=https:查找并替换xdg-open

  3. 将gdocs.desktop从〜/ .local / share / applications /拖到启动器中

添加/删除工作空间行/列的快速列表

预习

使用Unity图标/快速列表轻松添加或删除虚拟桌面或工作区,目前在Ubuntu中错过了一个选项。 只有选项似乎进入gconf编辑器并手动更改它们。
理想情况下,这将使其进入Workspace Switcher。

它依赖于一个脚本来提取当前行数和列数,并在再次设置之前添加或减去一个。 它还检查它不会低于一行或一列。

  1. 在终端类型中使用gedit创建一个新的.desktop文件:

     gedit ~/.local/share/applications/workspaces.desktop 
  2. 将此文本复制并粘贴到新创建的文件中:

     [Desktop Entry] Version=1.0 Name=Workspaces Comment=Change Workspace Numbers GenericName=Workspace Editor Terminal=false Type=Application Icon=desktop X-Ayatana-Desktop-Shortcuts=AddRow;RmRow;AddColumn;RmColumn; [AddRow Shortcut Group] Name=Add Row Exec=workspaces-shortcuts rows + TargetEnvironment=Unity [AddColumn Shortcut Group] Name=Add Column Exec=workspaces-shortcuts cols + TargetEnvironment=Unity [RmRow Shortcut Group] Name=Remove Row Exec=workspaces-shortcuts rows - TargetEnvironment=Unity [RmColumn Shortcut Group] Name=Remove Column Exec=workspaces-shortcuts cols - TargetEnvironment=Unity 
  3. 在终端类型中使用gedit创建一个新脚本:

     gksudo gedit /usr/bin/workspaces-shortcuts 

    注意:使用gksudo是因为我们将保存它的位置,因为它是一个图形应用程序。

  4. 将此文本复制并粘贴到新创建的文件中:

     #!/bin/bash case $1 in rows)t=v;; cols)t=h;; esac; check=`gconftool-2 --get /apps/compiz-1/general/screen0/options/${t}size` if [[ ! ($2 = - && $check < 2 ) ]] then [[ $2 = [-+] ]] && gconftool-2 --set /apps/compiz-1/general/screen0/options/${t}size --type int $(( $check $2 1 )) fi 
  5. 在终端类型中使脚本可执行:

    sudo chmod a+x /usr/bin/workspaces-shortcuts

  6. 通过导航到Nautilus中的〜/ .local / share / applications / 拖放到启动器上。

    通过在.desktop文件中更改以下行来轻松完成排序:

     X-Ayatana-Desktop-Shortcuts=AddRow;RmRow;AddColumn;RmColumn; 

     X-Ayatana-Desktop-Shortcuts=AddRow;AddColumn;RmRow;RmColumn; 

    例如。

Chromium快速清单

铬

  1. 将Chromium启动器复制到您的主目录,在终端粘贴以下内容:

     cp /usr/share/applications/chromium-browser.desktop ~/.local/share/applications 
  2. 打开此文件进行编辑:

     gedit ~/.local/share/applications/chromium-browser.desktop 
  3. 突出显示并复制下面的文本,然后将其粘贴到文件的底部

     X-Ayatana-Desktop-Shortcuts=NewWindow;Incognito; [NewWindow Shortcut Group] Name=New Window Exec=chromium-browser TargetEnvironment=Unity [Incognito Shortcut Group] Name=New incognito window Exec=chromium-browser --incognito TargetEnvironment=Unity 

资源

Gedit快速清单

gedit中

  1. 使用终端将“Gedit”启动器文件复制到您的主目录

     cp /usr/share/applications/gedit.desktop ~/.local/share/applications 
  2. 在gedit中打开文件进行编辑:

     gedit ~/.local/share/applications/gedit.desktop 
  3. 将此文本添加到文件的底部 ,并替换 文本以匹配您的主文件夹用户名,然后保存并关闭:

     X-Ayatana-Desktop-Shortcuts=OpenDoc;OpenDocRoot; [OpenDoc Shortcut Group] Name=Open file... Exec=/home//.local/share/applications/scripts/gedit-shortcuts normal-mode TargetEnvironment=Unity [OpenDocRoot Shortcut Group] Name=Open file as root... Exec=/home//.local/share/applications/scripts/gedit-shortcuts root-mode TargetEnvironment=Unity 
  4. 在〜/ .local / share / applications文件夹中创建’scripts’文件夹:

     mkdir ~/.local/share/applications/scripts 
  5. 使用gedit创建脚本文件’gedit-shortcuts’:

     gedit ~/.local/share/applications/scripts/gedit-shortcuts 
  6. 将此文本添加到文件,然后保存并关闭:

     #!/bin/bash case $1 in normal-mode) gedit $(zenity --title='Open file...' --file-selection);; root-mode) gksudo -u root -m "Running Gedit as user root allow you to modify some essential files of your system" "bash -c 'gedit \$(zenity --title=\'Open file as user root...\' --file-selection)'";; esac 
  7. 使文件可执行:

     chmod +x ~/.local/share/applications/scripts/gedit-shortcuts 
  8. 将gedit.desktop文件从nautilus中的〜/ .local / share / applications拖放到Unity Launcher Bar

Filezilla FTP快速列表

使用Filezilla启动器快速访问您喜欢的FTP服务器。

filezilla快速列表

制作FileZille快速列表有两种选择。 您可以链接到站点管理器中的站点(安全选项); 或者您可以直接在.desktop文件中输入连接信息(没有站点管理器的选项)。

链接到站点管理器(安全选项)

  1. 将Filezilla启动器复制到您的主目录,在终端粘贴以下内容:

     cp /usr/share/applications/filezilla.desktop ~/.local/share/applications 
  2. 打开此文件进行编辑:

     gedit ~/.local/share/applications/filezilla.desktop 
  3. 将下面的文本附加到.desktop文件的底部 ,为要链接的每个站点添加“快捷方式组”。 在Exec参数中,您应该将FTP站点的路径放在站点管理器中。 2°快捷方式直接打开Filezilla站点管理器。

     X-Ayatana-Desktop-Shortcuts=Server1;sitemanager [Server1 Shortcut Group] Name=Site Name Exec=filezilla -c "0/Folder Name/Site Name" TargetEnvironment=Unity [sitemanager Shortcut Group] Name=Site Manager Exec=filezilla -s TargetEnvironment=Unity 

有关详细信息,您应该查看Filezilla wiki上的命令行参数页面。

资源


直接输入连接详细信息(快速但不安全的选项)

注意:此选项存在安全问题,因为您将以 纯文本格式存储密码。 只有当你知道风险时才这样做,这是一种非常“hackish”的做事方式。 如果您在FileZilla中使用站点管理器, 请使用上面的选项,选项使用已存储在Filezilla Site Manager配置中的信息。

  1. 将Filezilla启动器复制到您的主目录,在终端粘贴以下内容:

     cp /usr/share/applications/filezilla.desktop ~/.local/share/applications 
  2. 打开此文件进行编辑:

     gedit ~/.local/share/applications/filezilla.desktop 
  3. 突出显示并复制下面的文本,然后将其粘贴到.desktop文件的底部 。 编辑FTP服务器详细信息以匹配您自己的详细信息,然后保存文件。

     X-Ayatana-Desktop-Shortcuts=Server1; [Server1 Shortcut Group] Name=FTP into test server Exec=filezilla ftp://test:test@ftp.secureftp-test.com:21 TargetEnvironment=Unity 

    您需要分别使用您的用户名/密码更改“test:test”,并使用ftp服务器的域更改“ftp.secureftp-test.com”。

资源

灯泡快速清单

截图

  1. 打开一个新文件:

     gedit ~/.local/share/applications/lamp.desktop 
  2. 复制下面的文字

     [Desktop Entry] Name=LAMP GenericName=LAMP X-GNOME-FullName=LAMP Comment=Open services of your LAMP server Exec=gksu service apache2 start && gksu service mysql start Icon=emblem-web Terminal=false Type=Application StartupNotify=true X-Ayatana-Desktop-Shortcuts=Start;Stop;Restart [Start Shortcut Group] Name=Start Exec=gksu service apache2 start && gksu service mysql start TargetEnvironment=Unity [Stop Shortcut Group] Name=Stop Exec=gksu service apache2 stop && gksu service mysql stop TargetEnvironment=Unity [Restart Shortcut Group] Name=Restart Exec=gksu service apache2 restart && gksu service mysql restart TargetEnvironment=Unity 
  3. 通过导航到Nautilus中的〜/ .local / share / applications /拖放到启动器上。

Rhythmbox快速列表

Screenshot

  1. 将Rhythmbox启动器复制到您的主目录,在终端粘贴以下内容:

     cp /usr/share/applications/rhythmbox.desktop ~/.local/share/applications 
  2. 打开此文件进行编辑:

     gedit ~/.local/share/applications/rhythmbox.desktop 
  3. 突出显示并复制下面的文本,然后将其粘贴到文件的底部:

     X-Ayatana-Desktop-Shortcuts=Play;Pause;Previous;Next;Stop [Play Shortcut Group] Name=Play Exec=rhythmbox-client --play TargetEnvironment=Unity [Pause Shortcut Group] Name=Pause Exec=rhythmbox-client --pause TargetEnvironment=Unity [Previous Shortcut Group] Name=Previous Exec=rhythmbox-client --previous TargetEnvironment=Unity [Next Shortcut Group] Name=Next Exec=rhythmbox-client --next TargetEnvironment=Unity [Stop Shortcut Group] Name=Stop Exec=rhythmbox-client --stop TargetEnvironment=Unity 
  4. 保存文件。

Google Chrome快速列表

镀铬快速清单

  1. 将Google Chrome启动器复制到您的主目录,在终端粘贴以下内容:

     cp /opt/google/chrome/google-chrome.desktop ~/.local/share/applications 
  2. 打开此文件进行编辑:

     gedit ~/.local/share/applications/google-chrome.desktop 
  3. 突出显示并复制下面的文本,然后将其粘贴到文件的底部

     X-Ayatana-Desktop-Shortcuts=NewWindow;Incognito; [NewWindow Shortcut Group] Name=New Window Exec=google-chrome TargetEnvironment=Unity [Incognito Shortcut Group] Name=New incognito window Exec=google-chrome --incognito TargetEnvironment=Unity 

资源

雷鸟快速清单

雷鸟灯笼

  1. 将启动器文件复制到您的主目录:

    cp /usr/share/applications/thunderbird.desktop ~/.local/share/applications/thunderbird.desktop

  2. 使用文本编辑器打开文件

    gedit ~/.local/share/applications/thunderbird.desktop

  3. 添加文件底部的文本并保存。

    X-Ayatana-Desktop-Shortcuts=Compose;AddressBook;ProfileManager;

     [Compose Shortcut Group] Name=Compose Exec=thunderbird -compose TargetEnvironment=Unity [AddressBook Shortcut Group] Name=Address Book Exec=thunderbird -addressbook TargetEnvironment=Unity [ProfileManager Shortcut Group] Name=Profile Manager Exec=thunderbird -ProfileManager TargetEnvironment=Unity 

矿井快速清单

从发射器快速启动我的新游戏。

矿井快速清单

  1. 将Mines启动器复制到您的主目录,在Terminal中粘贴以下内容:

     cp /usr/share/applications/gnomine.desktop ~/.local/share/applications 
  2. 打开此文件进行编辑:

     gedit ~/.local/share/applications/gnomine.desktop 
  3. 突出显示并复制下面的文本,然后将其粘贴到.desktop文件的底部

     X-Ayatana-Desktop-Shortcuts=Small;Medium;Large; [Small Shortcut Group] Name=New Game (Small) Exec=gnomine -f 0 TargetEnvironment=Unity [Medium Shortcut Group] Name=New Game (Medium) Exec=gnomine -f 1 TargetEnviroment=Unity [Large Shortcut Group] Name=New Game (Large) Exec=gnomine -f 2 TargetEnviroment=Unity 

资源

DéjàDup快速清单

DéjàDup快速清单

  1. 使用终端将DéjàDup启动器文件复制到您的主目录:

     cp /usr/share/applications/deja-dup.desktop ~/.local/share/applications 
  2. 在文本编辑器中打开文件进行编辑:

     gedit ~/.local/share/applications/deja-dup.desktop 
  3. 将此文本添加到文件的底部 ,然后关闭并保存:

     X-Ayatana-Desktop-Shortcuts=BackupNow; [BackupNow Shortcut Group] Name=Backup Now Exec=deja-dup --backup TargetEnvironment=Unity 
  4. 从Launcher中删除DéjàDupIcon(取消勾选Keep In Launcher )然后从Dash打开应用程序,应该出现新的快速列表,您可以重新勾选Keep In Launcher

Opera Quicklist

在此处输入图像描述

  1. 将原始.desktop文件复制到主目录中进行编辑:

     cp /usr/share/applications/opera-browser.desktop ~/.local/share/applications 
  2. 打开终端并输入以下内容:

     gedit ~/.local/share/applications/opera-browser.desktop 
  3. 在文件的底部,添加以下行,然后保存并关闭:

     X-Ayatana-Desktop-Shortcuts=NewTab;NewPrivateTab;NewWindow;Mail; [NewTab Shortcut Group] Name=New Tab Exec=opera -newtab TargetEnvironment=Unity [NewPrivateTab Shortcut Group] Name=New Private Tab Exec=opera -newprivatetab TargetEnvironment=Unity [NewWindow Shortcut Group] Name=New Window Exec=opera -newwindow TargetEnvironment=Unity [Mail Shortcut Group] Name=Mail Exec=opera -mail TargetEnvironment=Unity 
  4. 将图标添加到启动器(如果尚未添加),您的快速列表现在应该正常工作。

小贴士

如果需要,您还可以通过将其Exec命令替换为(例如)来使Mail在特定地址处打开新选项卡:

 Exec=opera -newtab "http://www.gmail.com/" 

来源, 1,2,3

Ubuntu One快速清单

连接到服务器,断开与服务器的连接并快速停止Ubuntu One syncdaemon。

在此处输入图像描述

  1. Copy the original Ubuntu One Control Panel icon to your home directory for editing:

     cp /usr/share/applications/ubuntuone-control-panel-gtk.desktop ~/.local/share/applications/ 
  2. Open the file for editing with gedit:

     gedit ~/.local/share/applications/ubuntuone-control-panel-gtk.desktop 
  3. Highlight and copy the text below, then paste it at the bottom of the .desktop file:

     X-Ayatana-Desktop-Shortcuts=Connect;Disconnect;Quit [Connect Shortcut Group] Name=Connect Exec=u1sdtool --connect TargetEnvironment=Unity [Disconnect Shortcut Group] Name=Disconnect Exec=u1sdtool --disconnect TargetEnvironment=Unity [Quit Shortcut Group] Name=Stop Ubuntu One Exec=u1sdtool --quit TargetEnvironment=Unity 

Transmission Quicklist

在此处输入图像描述

  1. Copy the global transmission-gtk.desktop file to your home directory:

     cp /usr/share/applications/transmission-gtk.desktop ~/.local/share/applications 
  2. Edit the file:

     gedit ~/.local/share/applications/transmission-gtk.desktop 
  3. Paste the following code to the bottom of the file:

     X-Ayatana-Desktop-Shortcuts=Pause All;Start All; [Pause All Shortcut Group] Name=Pause All Exec=transmission-remote -tall --stop TargetEnvironment=Unity [Start All Shortcut Group] Name=Start All Exec=transmission-remote -tall --start TargetEnvironment=Unity 

You may also show number of downloading torrents and total progress indicator using script from https://github.com/kriomant/transmission-unity-launcher

Firefox Quicklist Alternative

Puts a list of your favourite websites in the Firefox Quicklist.

End Result

  1. Copy firefox.desktop to home.

     cp /usr/share/applications/firefox.desktop ~/.local/share/applications 
  2. Open for editing

     gedit ~/.local/share/applications/firefox.desktop 
  3. Add to the bottom, edit the websites to your favorites

     X-Ayatana-Desktop-Shortcuts=OMGUbuntu;WebUpd8;UbuntuForums;AskUbuntu;UbuntuLaunchpad;NewWindow [OMGUbuntu Shortcut Group] Name=OMG! Ubuntu Exec=firefox -new-window 'http://www.omgubuntu.co.uk/' TargetEnvironment=Unity [WebUpd8 Shortcut Group] Name=WebUpd8 Exec=firefox -new-window 'http://www.webupd8.org/' TargetEnvironment=Unity [UbuntuForums Shortcut Group] Name=Ubuntu Forums Exec=firefox -new-window 'http://ubuntuforums.org' TargetEnvironment=Unity [AskUbuntu Shortcut Group] Name=Ask Ubuntu Exec=firefox -new-window 'http://askubuntu.com/' TargetEnvironment=Unity [UbuntuLaunchpad Shortcut Group] Name=Ubuntu Launchpad Exec=firefox -new-window 'https://launchpad.net/ubuntu' TargetEnvironment=Unity [NewWindow Shortcut Group] Name=Open a New Window Exec=firefox -new-window about:blank TargetEnvironment=Unity 

Gnome-Terminal Quicklist (auto-update from ssh config)

Here is a small shell script that updates your Gnome-Terminal-Quicklist with all your server entries in your ~/.ssh/config file. No manual manipulation is required. It reads your ~/.ssh/config file and creates the menu items from it. It also adds the “Root Terminal” menu entry.

Gnome terminal quicklist with ssh entries

  1. Copy the script listed below into an empty file and put it in your scripts-folder (we will assume that is ~/bin/ and the script name you choose is unityterm.sh ).
  2. Run the script once to add the entries:

     /bin/bash ~/bin/unityterm.sh 
  3. Optionally you may have cron run the script for you every once in a while. To add it to cron, type the follwing command into a shell:

     crontab -e 

    An editor will open. There add a line like:

     @reboot /bin/bash/ $HOME/bin/unityterm.sh > /dev/null 2>&1 

    If you don’t do this step, you’ll have to run the script by hand every time you change your ~/.ssh/config if you want the quicklist updated.

  4. Changes only take effect on your next login or after you Alt+F2ing

     unity --replace 

    So do that. Note: Don’t run unity --replace in a terminal. If you close that terminal, it will kill unity with it.

  5. Enjoy and have a look at the similar script for nautilus that parses your nautilus bookmarks.

Script:

这是脚本:

 #!/bin/bash # indent-mode: spaces, tabsize: 4, encoding: utf8 # # © 2011 con-f-use@gmx.net. Use under the MIT license: # http://www.opensource.org/licenses/mit-license.php # # CONTRIBUTORS: jacopoL  # # This script updates the unity quicklist menu for gnome-terminal to contain #+the user's bookmarks. The updates will have efect after unity is restarted #+(eigther after the next login or by invoking 'unity --replace'). # location of template, unity bar launchers and ssh config file tertempl="/usr/share/applications/gnome-terminal.desktop" target="$HOME/.local/share/applications/gnome-terminal.desktop" bookmarks="$HOME/.ssh/config" # backup if file allready exists if [ -e "$target" ]; then echo "Creating backup of: $target." mv -n "$target" "$target.bak" fi # copy template cp "$tertempl" "$target" if ! grep -q 'OnlyShowIn=.*Unity' "$target"; then # add only if not already present sed -i "s/\(OnlyShowIn=.*\)/\1Unity;/" "$target" fi # add entries to template if ! grep -q 'X-Ayatana-Desktop-Shortcuts=' "$target"; then # add only if not already present echo -e "\nX-Ayatana-Desktop-Shortcuts=\n" >> "$target" else echo >> "$target" fi bmcount=0 # number of current bookmark while read bmline; do # walk lines in ssh config file # when a new host is found, write the data collected in previous loops test=$(echo "$bmline" | grep -oE 'Host[[:space:]]') if [ -n "$test" ]; then ishost=$(echo "$bmline" | sed -e 's/[ ^I]*Host[ ^I]\+\([-_\.A-Za-z0-9]\+\).*/\1/g') fi if [ -n "$ishost" ]; then if [ -n "$hostname" ]; then # write bookmark information cat - >> "$target" <<____________eof [Scg$bmcount Shortcut Group] Name=SSH into $oldhost Exec=gnome-terminal -x ssh $sshuser$hostname TargetEnvironment=Unity ____________EOF # extend shortcut list with current bookmark, prepending a ; if needed sed -i "s/\(X-Ayatana-Desktop-Shortcuts=\(.*;$\|$\)\)/\1Scg${bmcount};/ t s/\(X-Ayatana-Desktop-Shortcuts=.*\)/\1;Scg${bmcount};/" "$target" bmcount=$(($bmcount+1)) fi hostname="" sshuser="" oldhost="$ishost" ishost="" fi # collect data: hostname test=$(echo "$bmline" | grep -oE 'HostName[[:space:]]') if [ -n "$test" ]; then hostname=$(echo "$bmline" | sed -e 's/[ ^I]*HostName[ ^I]\+\([-_\.A-Za-z0-9]\+\).*/\1/g') fi # collect data: ssh user test=$(echo "$bmline" | grep -oE 'User[[:space:]]') if [ -n "$test" ]; then sshuser=$(echo "$bmline" | sed -e 's/[ ^I]*User[ ^I]\+\([-_\.A-Za-z0-9]\+\).*/\1@/g') fi done < "$bookmarks" # write bookmark information of last bookmark #+and add a root file manager entry cat ->> "$target" < 

Opera Launcher & Quicklist (Part 2)

  • Tab counter

    The total number of tabs you have open appears on the Launcher icon and is updated in real time as you open and close tabs;

  • Urgency

    When Opera is not in focus and a new tab is opened, the Opera icon in the Launcher now enters urgency mode and wiggles once;

  • Quicklist

    With (at the moment) limited support for Opera’s built in Mail client (M2).

    QuicklistUrgencyTab count

安装

  1. Extract the script from this zip into your home folder.

  2. Open Startup Applications and add an entry using the above script as follows:

    Command: python unity-opera.py

    startup

资源

Kudos go to Kyle Baker!

DeaDBeeF Quicklist

DeaDBeeF Quicklist

  1. Copy launcher file to your home directory:

     cp /usr/share/applications/deadbeef.desktop ~/.local/share/applications 
  2. Open the file for editing in gedit:

     gedit ~/.local/share/applications/deadbeef.desktop 
  3. Add this text to the bottom of the file, then close and save:

     X-Ayatana-Desktop-Shortcuts=Play;Pause;Stop;Next;Prev [Play Shortcut Group] Name=Play Exec=deadbeef --play TargetEnvironment=Unity [Pause Shortcut Group] Name=Pause Exec=deadbeef --pause TargetEnvironment=Unity [Stop Shortcut Group] Name=Stop Exec=deadbeef --stop TargetEnvironment=Unity [Next Shortcut Group] Name=Next Exec=deadbeef --next TargetEnvironment=Unity [Prev Shortcut Group] Name=Prev Exec=deadbeef --prev TargetEnvironment=Unity 
  4. Optional: Change the drag & drop function of the launcher so it appends files to the playlist instead of clearing it:

    Find Exec=deadbeef %F and Replace with Exec=deadbeef --queue %F


There are a few other commands available in deadbeef -h but these are the only ones that seem useful in a quicklist.

Custom Scripts Quicklist with GUI

Create Quicklist launcher for your scripts. Embedded GUI with automatic and manual option for adding entries. The automatic option can only add, with the manual you can modify the file directly.

1. Create custom .desktop file for launcher

 gedit ~/.local/share/applications/my_scripts.desktop 

2. Paste the following code and edit following:(line 5 is the way to folder with your scripts, in this example, this is folder with the name Scripts , you need to change it for your location. You can change also the line 6 which is an icon. And at the end change text to match your home folder username.

 [Desktop Entry] Name=My Scripts Folder Comment=Open your scripts folder TryExec=nautilus Exec=xdg-open /home//Scripts Icon=ibus-engine Terminal=false StartupNotify=true Type=Application Categories=GNOME;GTK;Core; OnlyShowIn=GNOME;Unity; X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=nautilus X-GNOME-Bugzilla-Component=general X-Ubuntu-Gettext-Domain=nautilus X-Ayatana-Desktop-Shortcuts=AddScript [AddScript Shortcut Group] Name=Add New Script Exec=/home//.local/share/applications/scripts/addscript TargetEnvironment=Unity 

3. Create a ‘scripts’ folder (if not exist) in ~/.local/share/applications folder:

 mkdir ~/.local/share/applications/scripts 

4. Create the script file ‘addscript’ with gedit (this is the GUI for adding entries to your quicklist):

 gedit ~/.local/share/applications/scripts/addscript 

5. Add this text to the file,then save and close

 #!/bin/bash menuitem=`zenity --list --title="My Scripts Launcher Manager" \ --width=300 --height=150 \ --text="Select action" \ --column="Pick" --column="Action" \ --radiolist TRUE Add-Script-Automatically FALSE Add/Edit/Delete-Manually` case $menuitem in Add-Script-Automatically ) hkey=$(zenity --entry --text "Set name for your script" --entry-text "" --title "Set name") if [ -z "$hkey" ]; then zenity --error --title "Set name for your script " --text="The script name is empty. Exiting ..." exit 0 fi ay=$(sed -n '/X-Ayatana-Desktop-Shortcuts/p' /$HOME/.local/share/applications/my_scripts.desktop) shortname2=$(echo "$hkey" | sed 's/\///g') shortname=$(echo "$shortname2" | sed 's/ /_/g') hkey3=$(zenity --entry --text "Set command for your script" --entry-text "" --title "Set command") if [ -z "$hkey3" ]; then zenity --error --title "Set command " --text="The command is empty. Exiting ..." exit 0 fi sed -i "s/$ay/$ay;$shortname/g" /$HOME/.local/share/applications/my_scripts.desktop echo "" >> /$HOME/.local/share/applications/my_scripts.desktop echo "[$shortname Shortcut Group]" >> /$HOME/.local/share/applications/my_scripts.desktop echo "Name=$hkey" >> /$HOME/.local/share/applications/my_scripts.desktop echo "Exec=$hkey3" >> /$HOME/.local/share/applications/my_scripts.desktop echo "TargetEnvironment=Unity" >> /$HOME/.local/share/applications/my_scripts.desktop zenity --info --title "New entry added" --text "Changes only take effect on next login" ;; Add/Edit/Delete-Manually) zenity --text-info --filename=/$HOME/.local/share/applications/my_scripts.desktop > /tmp/my_scripts.desktop.edited --title "Add/Edit/Delete Script" --editable --width 850 --height 480 cp /tmp/my_scripts.desktop.edited /$HOME/.local/share/applications/my_scripts.desktop rm /tmp/my_scripts.desktop.edited zenity --info --title "New entry added" --text "Changes only take effect on next login" ;; esac 

6. Make the file executable:

 chmod +x ~/.local/share/applications/scripts/addscript 

7.Drag & Drop the my_scripts.desktop file from ~/.local/share/applications in nautilus to the Unity Launcher Bar

8. You can start adding entries to your quicklist with clicking on ” Add New Script ” menu item

Extended Home Icon Quicklist

Quick Lists

  1. Copy ‘Home Folder’ launcher file to your home directory with Terminal:

     cp /usr/share/applications/nautilus-home.desktop ~/.local/share/applications 
  2. Open the file for editing in gedit:

     gedit ~/.local/share/applications/nautilus-home.desktop 
  3. Delete the following line from the file:

     OnlyShowIn=GNOME; 
  4. Add this text to the bottom of the file, then close and save:

     X-Ayatana-Desktop-Shortcuts=Amazon;Backgrounds;CD Covers;Documents;Downloads;Dropbox;DVD Projects;Google Earth;Listings;Music;Notes;Photographs;Podcasts;Public;Templates;Themes;Transmission;Videos [Amazon Shortcut Group] Name=Amazon Exec=nautilus Amazon TargetEnvironment=Unity [Backgrounds Shortcut Group] Name=Backgrounds Exec=nautilus Backgrounds TargetEnvironment=Unity [CD Covers Shortcut Group] Name=CD Covers Exec=nautilus CDCovers TargetEnvironment=Unity [Documents Shortcut Group] Name=Documents Exec=nautilus Documents TargetEnvironment=Unity [Dropbox Shortcut Group] Name=Dropbox Exec=nautilus Dropbox TargetEnvironment=Unity [Downloads Shortcut Group] Name=Downloads Exec=nautilus Downloads [DVD Projects Shortcut Group] Name=DVD Projects Exec=nautilus DVDProjects TargetEnvironment=Unity [Google Earth Shortcut Group] Name=Google Earth Exec=nautilus GoogleEarth TargetEnvironment=Unity [Listings Shortcut Group] Name=Listings Exec=nautilus Listings TargetEnvironment=Unity [Notes Shortcut Group] Name=Notes Exec=nautilus Notes TargetEnvironment=Unity [Photographs Shortcut Group] Name=Photographs Exec=nautilus Photographs TargetEnvironment=Unity [Podcasts Shortcut Group] Name=Podcasts Exec=nautilus Podcasts TargetEnvironment=Unity [Public Shortcut Group] Name=Public Exec=nautilus Public TargetEnvironment=Unity [Templates Shortcut Group] Name=Templates Exec=nautilus Templates TargetEnvironment=Unity [Themes Shortcut Group] Name=Themes Exec=nautilus Themes TargetEnvironment=Unity [Transmission Shortcut Group] Name=Transmission Exec=nautilus Transmission TargetEnvironment=Unity [Videos Shortcut Group] Name=Videos Exec=nautilus Videos TargetEnvironment=Unity 
  5. Log out and log in again to see the changes.

VirtualBox Quicklist

This adds a quicklist entry for your Virtualbox virtual machines. The following example uses ‘Windows XP’ so will require editing to match your own VM details.

  1. Copy the file to your home directory

     cp /usr/share/applications/virtualbox.desktop ~/.local/share/applications/virtualbox.desktop 
  2. Open the file with Text Editor

     gedit ~/.local/share/applications/virtualbox.desktop 
  3. Add the text at the bottom of the file and save it.

     X-Ayatana-Desktop-Shortcuts=WindowsXP [WindowsXP Shortcut Group] Name=Start Windows XP Exec=/usr/lib/virtualbox/VirtualBox --comment "Windows XP" --startvm "Windows XP" TargetEnvironment=Unity 
  4. Drag & Drop the virtualbox.desktop file from ~/.local/share/applications in nautilus to the Unity Launcher Bar