2024年11月Ubuntu Unity在线搜索只显示终端应用的技巧

发布时间:

  ⑴相信大家在Ubuntu下使用Unity的在线搜索功能的时候,一定遇到过这样的问题,那就是搜索出来的结果总是带有第三方应用,不胜其烦,下面小编就教大家让Unity只显示终端应用的方法。

  ⑵正如上面的截图所见,Unity显示内置的 Terminal 应用、引用链接、天气链接和其他第三方的推荐,如电影等。显示了太多的搜索结果。

  ⑶在终端输入以下命令:

  ⑷wget -q -O - | bash

  ⑸上述脚本的内容如下:

  ⑹#!/bin/bash

  ⑺GS=“/usr/bin/gsettings”

  ⑻UL=“.canonical.Unity.lenses”

  ⑼# Figure out the version of Ubuntu that you‘re running

  ⑽V=`/usr/bin/lsb_release -rs`

  ⑾# The privacy problems started with ., so earlier versions should do nothing

  ⑿if awk “BEGIN {exit !($V 《 . || $V 》= .}”;then

  ⒀echo “Good news! This version of Ubuntu is not known to invade your privacy.”

  ⒁# Check Canonical schema is present. Take first match, ignoring case.

  ⒂SCHEMA=“`$GS list-schemas | grep -i $UL | head -`”

  ⒃if[-z “$SCHEMA”]

  ⒄printf “Error: could not find Canonical schema %s.

  ⒅”“$UL”》&

  ⒆UL=“$SCHEMA”

  ⒇# Turn off “Remote Search”, so search terms in Dash don’t get sent to the inter

  ⒈$GS set $UL remote-content-search none

  ⒉# If you‘re using earlier than ., uninstall unity-lens-shopping

  ⒊if[ $V 《 .];then

  ⒋sudo apt-get remove -y unity-lens-shopping

  ⒌# If you’re using a later version, disable remote scopes

  ⒍$GS set $UL disabled-scopes

  ⒎“[‘more_suggestions-amazon.scope’, ‘more_suggestions-ums.scope’,

  ⒏‘more_suggestions-populartracks.scope’, ‘music-musicstore.scope’,

  ⒐‘more_suggestions-ebay.scope’, ‘more_suggestions-ubuntushop.scope’,

  ⒑‘more_suggestions-skimlinks.scope’]”

  ⒒# Block connections to Ubuntu‘s ad server, just in case

  ⒓if! grep -q “... productsearch.ubuntu.”/etc/hosts;then

  ⒔echo -e “

  ⒕... productsearch.ubuntu.”| sudo tee -a /etc/hosts 》/dev/null

  ⒖echo “All done. Enjoy your privacy.”

  ⒗再次进入Unity dash 的终端。现在Unity 只显示终端应用。

  ⒘更新:这一招只适用Unity desktop。如果你使用其他的比如GNOME,LXDE或Xfce不用这么做。同时,这个在线搜索功能将不会包含在Ubuntu .和即将推出的版本中。

  ⒙上面就是Ubuntu unity在线搜索只显示终端应用的方法介绍了,在终端输入如上命令后,搜索的结果中就不会有第三方应用,让页面更简洁。