学以致用

focus on Python , C++, and some interest in Go and R

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

对ubuntu 12.04自定义launcher的方法做一记录,希望能对有需要的朋友有所帮助

以sublime text 2的launcher定义为例
(1) 添加简介命令来启动sublime
    sudo ln -s /opt/softwares/Sublime_Text2/sublime_text   /usr/bin/sublime
(2)在Unity创建一个launcher
  sudo sublime /usr/share/applications/sublime.desktop
  在sublime.desktop中添加如下内容
        [Desktop Entry]
       Name=Sublime Text 2
       GenericName=Sublime Text 2 Editor
       Type=Application
       Exec=/opt/softwares/Sublime_Text2/sublime_text
       Icon=/opt/softwares/Sublime_Text2/Icon/48x48/sublime_text.png
       Categories=TextEditor;IDE;Development;
       X-Ayatana-Desktop-Shortcuts=Runroot;Newwindow
       [Runroot Shortcut Group]
       Name=Run as root
       Exec=gksudo -k -u root /opt/softwares/Sublime_Text2/sublime_text
       TargetEnvironment=Unity
       [Newwindow Shortcut Group]
       Name=New Window
       Exec=/opt/softwares/Sublime_Text2/sublime_text -n
       TargetEnvironment=Unity

(3)如果此时sublime处于运行状态,则在ubuntu左侧launcher窗口应该出现一个sublime的图标,点击右键,并选择Lock to Launcher即可

注:sublime 的安装路径请自行根据实际情况进行调整

posted on 2012-08-21 17:51  Jerry.Kwan  阅读(2210)  评论(0编辑  收藏  举报