
我正在使用 Python + PyGObject 建立 Unity AppIndicator,但我希望它的圖示採用標準 Ubuntu 風格。我可以在哪裡找到使用顏色的適當指南(或只是白色/透明?),或至少是標準 AppIndicators 的圖示?大約是 13.04,我想,這個版本之後圖示樣式不會有太大變化(儘管我們會看到)。
另外,我還有一個關於將圖示設定為指示器的問題。如果我將它放在與 .py 檔案相同的資料夾中,我應該如何在程式碼中引用它?
答案1
若要使用位於 python 腳本資料夾中的自訂圖標,請使用這種方式(PyGI 程式碼片段)
appindicator.Indicator.new_with_path (
"indicator-name",
"icon-name",
appindicator.IndicatorCategory.APPLICATION_STATUS,
os.path.dirname(os.path.realpath(__file__))