Web Search bar that launches web browser in an AppVM?

Hello all,
Have been using Qubes for several weeks → best OS of all time!!

I’d like to start this thread to see if there is a secure way to add a WEB SEARCH feature to either the main xfce panel, or to the wiskers menu??

Ideally this search bar would trigger/be-assigned-to the appVM that I do majority of my browsing.

Search of Files/Folders would also be nice, but honesty easy/quick web search bar more important for productivity

Any thoughts?

1 Like

Hi @ark, I’m glad you also like Qubes OS!

You can add a shortcut to any application in any VM. Here is an instruction: Installing Software in Qubes from .deb / .rpm.

You can add a shortcut to your browser of choice and use its address bar as a search I guess. Would it be a good enough solution?

For some reason the link doesn’t take me to the right spot. If this happens to you @ark, then natigate to " 4. Adding shortcut to start menu".

gnome-do and kupfer have plugins for searching files and probably for doing web searches. Maybe just bind a keyboard shortcut in dom0 to qvm-run <appvm> gnome-do?

Or just bind a browser to a keyboard shortcut, since the browser interface contains a search bar you’ll end up opening a browser to view search results anyway.

This will not work because dom0 (the admin qube that manages the desktop and Q menu) is offline.

The best bet, I think is adding a shortcut to open a web-browser in a specific qube.

Not sure if related but look at: How to configure qubes.OpenURL to ask which qube to open the URL in?

The actual gnome-do / kupfer / browser is run in the appvm.that has access to files / internet: qvm-run appvm gnome-do etc…

To clarify, this will create a popup search box, it won’t be physically connected to the xfce panel in dom0.

1 Like

I’m a fan of dmenu.

Here’s a dmenu script which requests user input and then searches that in Firefox in a specified AppVM. You first tell dmenu whether you want to give Firefox a URL or a web search using Firefox’s default search engine. Then you put in your query.

If you want to open https://eff.org, then you first select URL and then type eff.org. If you want to search on the web eff.org, you first select Web and then type eff.org.

#!/bin/bash

# This dmenu script asks for a web search,
# and runs that search in an AppVM.

APP_VM=productivity

# Choose URL or Web search, exit if empty (i.e. <Esc>)
QUERY_TYPE=$(echo -e "URL\nWeb" | dmenu -i)
[[ -z $QUERY_TYPE ]] && exit

# Input search query, exit if empty
QUERY=$(echo "" | dmenu)
[[ -z $QUERY ]] && exit

[[ $QUERY_TYPE = "URL" ]] &&
qvm-run $APP_VM firefox -- -new-window $QUERY ||
qvm-run $APP_VM firefox -- -new-window --search $QUERY || exit

Notes

  1. Sometimes dmenu accepts the user’s input without having to pipe something to dmenu, but this hasn’t worked for me. So I just pipe in an empty list with echo "" | dmenu.

  2. If you want to choose from a list of VMs instead of only defining one VM in the script, you can pipe a list of VMs into dmenu and make a VM variable which you use with qvm-run $VM.
    If you want a list of currently running VMs to pipe into dmenu, you can use VM_LIST=$(qvm-ls | awk '{print $1}' | tail -n+2). Alternatively, you can use a cron job (I use */5 * * * *) to write $VM_LIST to a file, and then use echo "$VM_LIST" | dmenu to choose the VM (this shaves off the noticeable half second that it takes qvm-ls to run).

  3. If you need to visit .com URL, you don’t need to type .com, as either qvm-run or Firefox seems to default to this top-level domain.

  4. You could add a search engine selection to this script by getting the search engine’s search URL, and then piping a list of those into dmenu. See this (Invidious) video by Distrotube.

Hope this helps.

4 Likes

Nice. Thanks!

1 Like