
我的問題是這樣的:我有一個與 Wine 一起安裝的軟體(Brain Explorer 2,免費);軟體的某些功能需要使用瀏覽器(在本例中為 google chrome;firefox 不是選項,因為這需要 flash 播放器...)。然後,Explorer 開啟瀏覽器。當你瀏覽網站時,有一個選項將資料從瀏覽器載入到軟體,然後瀏覽器請求外部協議艾貝:連結(我想 aib 是 Allen Institute Brain Explorer 的意思),最終以啟動 xdg-open 結束,據我所知,它處理預設應用程式。
所以我想必須嘗試配置 aibe 連結的預設應用程序,但老實說我迷路了。我想到的最多的是類似磁力連結與種子。當然在windows上就不存在這樣的問題,因為是專門為它設計的。但是我如何在 Ubuntu 上實現這一點呢?
答案1
使其發揮作用:
- 跑步
gedit ~/.local/share/applications/allen-brainexplorer.desktop
將會開啟一個文字編輯器。將以下內容貼到其上:
[Desktop Entry] Name=Brain Explorer 2 Exec=wine "%ProgramFiles%\Allen Institute\Brain Explorer 2\BrainExplorer2.exe" "/url" "%u" Type=Application Terminal=false MimeType=x-scheme-handler/aibe;
- 儲存檔案並關閉文字編輯器。
執行以下命令將新建立的檔案「安裝」到系統中:
xdg-desktop-menu install ~/.local/share/applications/allen-brainexplorer.desktop
- 當瀏覽器提示您如何處理此類連結時,選擇運行應用程式。
我是如何得到它的:
我已經在 Windows XP 虛擬機器上安裝了 Brain Explorer 2,這樣我就可以打開 regedit 並找到該金鑰:
HKEY_CLASSES_ROOT\aibe\shell\open\command
該鍵包含以下內容:
"C:\Program files\Allen Institute\Brain Explorer 2\BrainExplorer2.exe" /url "%1"
這意味著該/url
選項允許將 URL 傳遞給 BrainExplorer。例子:
wine "/home/$USER/.wine/dosdevices/drive_c/Program files/Allen Institute/Brain Explorer 2/BrainExplorer2.exe" /url "aibe://human.brain-map.org/mri_viewer/data/heatmap/probe_values?atlas=351&resolution=samples&probes=1036443&selectedDonor=9861&well=2569&colormap=redgreen&exprRange=-6,6"