1. 程式人生 > >linux desktop檔案 icon屬性查詢邏輯

linux desktop檔案 icon屬性查詢邏輯

遇到一個問題,就是應用在啟動器的圖示不顯示,然後在桌面和dock都正常
在這裡插入圖片描述
在這裡插入圖片描述
我自己寫的檔案內容如下

[Desktop Entry]
Categories=System;
Comment=Deepin Graphics Driver Manager is a compact and easy  to use graphics driver managing tool.
Exec=bulbasaur
GenericName=Bulbasaur
GenericName[zh_CN]=妙蛙種子
Icon=bulbasaur
Name=Bulbasaur
Name[zh_CN]=妙蛙種子
StartupNotify=true
Terminal=false
Type=Application
X-Deepin-Vendor=user-custom

/usr/share/icons路徑下有png檔案
在這裡插入圖片描述
百度是沒找到任何有用的東西。
上Google,找到這個,原文在:Installing icons

The desktop looks for icons in the selected theme directory of
/usr/share/icons/. Application icons should be available at least at a
resolution of 48x48 pixels. Place the icon in
/usr/share/icons/hicolor/48x48/apps/.

我放在這個資料夾下,也沒有什麼用,最後直接把路徑寫死,OK

Icon=/usr/share/icons/bulbasaur.png

在這裡插入圖片描述