Linux下案頭捷徑建立執行個體

來源:互聯網
上載者:User

   今天到網上搜ubuntu建立案頭捷徑,發現儘是些不負責任,有問題的教程,故我也發教程一篇

  在你的Home/Desktop檔案夾下面建立一個xxx.desktop的檔案,並且加上執行許可權

  複製代碼

  代碼如下:

  chmod +x xxx.desktop

  具體內容參照下面的模板,順便講一下linux下軟體的安裝方法,以sublime text 2為例

  下載sublime linux的安裝包,在你的home目錄建立一個目錄名,可以叫app,或者myapps啥的,你自己明白就行,就是軟體的安裝目錄,把sublime text 2解壓到裡面,於是整體的目錄結構如下

  代碼如下:

  --homeyournam

  ----apps

  ------sublime text 2

  下面解釋下模板的內容,第一行,是凡是標有可執行標記的指令碼必備的注釋,內容為執行該指令碼的解譯器地址,這裡是解釋案頭捷徑用的

  第二行開始就是具體的內容了

  解釋兩個重要的地方,地一個是exec,這個是你的可執行檔的地址,如果中間包含空格,那麼用引號擴起來

  Icon,這個是你的應用的表徵圖,要不預設表徵圖很難看

  代碼如下:

  #!/usr/bin/env xdg-open

  [Desktop Entry]

  Categories=Development;

  Comment[zh_CN]=

  Comment=

  Exec="/home/bowman/apps/Sublime Text 2/sublime_text"

  GenericName[zh_CN]=Sublime Texe 2

  GenericName=Sublime Texe 2

  Icon="/home/bowman/apps/Sublime Text 2/Icon/256x256/sublime_text.png"

  MimeType=

  Name[zh_CN]=Sublime Texe 2

  Name=Sublime Texe 2

  Path=

  StartupNotify=true

  Terminal=false

  Type=Application

  X-DBUS-ServiceName=

  X-DBUS-StartupType=

  X-KDE-SubstituteUID=false

  X-KDE-Username=owen

  關於category,這裡有一個主要列表可供選擇

  he table below lists all Main Categories.

  Main Category Description Notes

  AudioVideo Application for presenting, creating, or processing multimedia (audio/video)

  Audio An audio application Desktop entry must include AudioVideo as well

  Video A video application Desktop entry must include AudioVideo as well

  Development An application for development

  Education Educational software

  Game A game

  Graphics Application for viewing, creating, or processing graphics

  Network Network application such as a web browser

  Office An office type application

  Science Scientific software

  Settings Settings applications Entries may appear in a separate menu or as part of a "Control Center"

  System System application, "System Tools" such as say a log viewer or network monitor

  Utility Small utility application, "Accessories"

  references:

  http://standards.freedesktop.org/menu-spec/latest/apa.html#main-category-registry

  http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.