Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

CentOS 7 上手動建立桌面捷徑

在 CentOS 裝好 Eclipse 之後會發現一個小麻煩:只能到 Eclipse 的 bin 目錄去執行 eclipse 腳本才能啟動,桌面上一點捷徑都沒有。以下記錄手動建立 .desktop 捷徑的做法。

先切到桌面目錄:

cd /home/your_username/desktop

新增一個以 .desktop 結尾的文件:

vim eclipse.desktop

把下面的內容寫進去:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=eclipse
Type=Application
Terminal=false
Name[en_US]=eclipse
Exec=/opt/eclipse/mars/eclipse
Comment[en_US]=Eclipse Mars.2
Comment=Eclipse Mars.2
GenericName[en_US]=
Icon=/opt/eclipse/mars/eclipse.png

關鍵在於 Exec 要填 Eclipse 啟動腳本的實際路徑,Icon 則指向同目錄下的圖示檔。存檔後桌面就會出現可點擊的圖示。

Copyright © Linux教程網 All Rights Reserved