在 gnome-shell 的概览中,有两个用于 Google 和 Wikipedia 的搜索按钮。是否可以为 Ask Ubuntu 创建一个类似的按钮?
我发现fossfreedom 在 gnome-shell 中创建 DuckDuckGo 搜索按钮的答案很有用,我已经用它作为回答这个问题的基础。
要创建新的搜索提供程序,请将google.xml文件复制为模板。
11.10
sudo cp /usr/share/gnome-shell/search_providers/google.xml /usr/share/gnome-shell/search_providers/askubuntu.xml
Run Code Online (Sandbox Code Playgroud)
12.04
sudo cp /usr/share/gnome-shell/open-search-providers/google.xml /usr/share/gnome-shell/open-search-providers/askubuntu.xml
Run Code Online (Sandbox Code Playgroud)
更改askubuntu.xml文件中的以下 XML 标记:
<ShortName>Ask Ubuntu</ShortName>
<Description>Ask Ubuntu Search</Description>
<Url type="text/html" method="GET" template="https://askubuntu.com/?q={searchTerms}"/>
Run Code Online (Sandbox Code Playgroud)
如果您做对了一切,您应该会在概览中看到 Ask Ubuntu 搜索按钮。
