Auto clear search term from lens

There must be a setting or a shell script that would clear the terms from the lens every time it's closed.

The behaviour would be:

  1. open lens and type a term.
  2. reopen the lens with super key.
  3. see no search term is pre populating the lens.

The goal is not to just to clear the term, it's how to get the system to automatically do it for me. I don't like having to manually erase the last term used every time, especially if it wasn't useful. One problem this causes is, if the term only returned files, then all subsequent terms also only return files (I am using recoll-scope). I must hit 'esc' to fully clear it, before I'm able to search for an app.


Solution 1:

Disable the HUD history storage:

gsettings set com.canonical.indicator.appmenu.hud store-usage-data false    

Disable all scopes, use the launcher as an application drawer only:

gsettings set com.canonical.Unity.Dash scopes "['home.scope', 'applications.scope', 'files.scope']"
gsettings set com.canonical.Unity.Lenses always-search "['applications.scope', 'files.scope']"
gsettings set com.canonical.Unity.Lenses home-lens-default-view "['applications.scope', 'files.scope']"
gsettings set com.canonical.Unity.Lenses home-lens-priority "['applications.scope', 'files.scope']"
gsettings set com.canonical.Unity.Lenses remote-content-search none    

Via here (more tips as well)