I have connected this script to a keyboard shortcut for when I am holding my five month old son. It is quicker than having to type with one hand. I have an SSD so launching Chromium is fast. If you have an HDD, you'll need to use
pgrep to see if Chromium is running already, if so, sleep less time, if not sleep more time until Chromium loads. (I could add this segment if needed.) The sleep aspect is there so all page content loads before running the
xdotool command at the end. I am assuming here that you would be using Chromium and that your default page is the Google search page. My script also moves Chromium to the middle monitor, but I have commented out those lines assuming you have one screen. You will need
xdotool installed with the command
sudo apt install xdotool for the script to work. The following is less instant than other virtual assistants, but it works every time for me. It basically selects the little Google Now/Search microphone and hits enter for you.
# window_id=$(xdotool getactivewindow)
# Un-maximize to move
# wmctrl -ir $window_id -b remove,maximized_vert,maximized_horz
# Move window to middle screen
# xdotool windowmove $window_id 2000 200
# Maximize again
# wmctrl -ir $window_id -b add,maximized_vert,maximized_horz
# sleep 1
# I need to do 6 tabs then enter.
xdotool key Tab Tab Tab Tab Tab Tab Return