问题描述
在gnome-shell中搜索时,屏幕底部有两个按钮,可用于通过Wikipedia和Google进行搜索。
有什么办法可以自定义这些?例如,如果我想用一个DuckDuckGo替换Google按钮,我将如何处理?
最佳方法
Gnome-Shell搜索提供程序由文件夹/usr/share/gnome-shell/search_providers
中的XML文件描述
您会注意到两个XML文件-google.xml和wikipedia.xml
让我们创建一个新的搜索提供程序-将google.xml文件复制为模板
11.10
sudo cp /usr/share/gnome-shell/search_providers/google.xml /usr/share/gnome-shell/search_providers/duckduckgo.xml
12.04
sudo cp /usr/share/gnome-shell/open-search-providers/google.xml /usr/share/gnome-shell/open-search-providers/duckduckgo.xml
现在,打开文件并更改一些详细信息以使用duckduckgo搜索:
11.10
sudo nano /usr/share/gnome-shell/search_providers/duckduckgo.xml
12.04
sudo nano /usr/share/gnome-shell/open-search-providers/duckduckgo.xml
更改以下XML标签:
<ShortName>DuckDuckGo</ShortName>
<Description>DuckDuckGo Search</Description>
<Url type="text/html" method="GET" template="http://www.duckduckgo.com/?q={searchTerms}"/>
唯一困难的部分是找出搜索引擎的搜索方式-在duckduckgo中,我搜索了一些内容-您会在标题栏中看到搜索提供商如何添加其搜索词
最后结果
为了查看更改,您需要通过按Alt + F2并键入”r”并按Enter来重新启动GNOME Shell。
链接的问题: