How to run search in AppVm / DVM from dom0?

I know it would use something like:

sudo qvm-run -a media firefox --new-tab --search ??

but I am obviously doing something wrong as I cannot figure the exact text I would use to pass the term/text to firefox?
Ultimately I want to be able to run a search directly from rofi

after some more searching I found a rofi-web-search py script I think it would be great… except I am even less sure how to execute it from dom0?

the instructions are for binding it to kyes in i3:

bindsym --release $mod+x exec --no-startup-id rofi -lines 10 -padding 0 -show search -modi search:~/bin/rofi-web-search.py -i -p "Search: "

I am not sure if I would be adding qvm-run firefox etc in the rofi-web-search.py file, or in the config.xresources

would love to get this going but am stuck…

qvm-run -a media “firefox --new-tab --search ‘what time is it in london?’”

Thanks for that and it worked!

I guess the next question is how can I say use that in a .desktop file? like pass “what time is it in london” or whatever else to firefox, or in this case pass it to rofi-web-search.py (maybe stdin? sorry am not sure about the correct term).

Maybe I should update the title to “how to run web search from rofi”?

It won’t work. I just looked at rofi-web-search.py and what it does.
Since you don’t have network in dom0 the script won’t be able to
interface with the search engine of your choice … hence it won’t be
able to give you results to choose from.

Thats unfortunate, but thanks for confirming that.
Perhaps I am “aiming too high”? I dont really need suggestions, would be totally fine with being able to pass a search to firefox in an appvm, would that be possible with rofi? I figured it out using the xfce launcher awhile back but cant find the post/email thread (had to ask for help on that too if i recall correctly).

Can you not adapt this?
qvm-run -a "firefox --new-tab --search "?

I think I am not clear on what it is you are trying to achieve.

Maybe using sys-gui would work, but i haven’t tested it.

i think, something like search bar in desktop.

Sorry for the ambiguity.

I am hoping to use rofi to launch a search. So I could open rofi, type (example):
personal firefox

or maybe a keyword:
s

or could be a rofi mode? That is, you can have different modes in rofi like combi, drun, window so maybe a “search mode”?

Ultimately I am trying to have the option to quickly do a search, in either a specific appvm or could just be a dedicated vm (dvm?) without having to first open a browser, go to the search site, then type the phrase etc (not that those steps are huge, just for my workflow being able to say type something like:

s

and then have the results pop up in a browser would be really convenient.

sys gui? am not familar with that, is it a v4.1 thing?

but yes, effectively something like a search bar in the desktop, except ideally I could launch the search from a launcher like rofi.

I went back to the settings manager → xfce app finder → custom actions, and it has various examples/patterns added by default most using “exo-open”, so typing:

!w

which would apparently execute:

exo-open --launch WebBrowser http://en.wikipedia.org/wiki/%s

so i guess I am hoping to do something similar in rofi, that is be able to type !w (or whatever) and run something like a duckduckgo search in say a dvm?

Sorry for the ambiguity.

Right, and you want to do this in dom0?
Why cant you simply script a simple search using qvm-run?
qvm-run -a <qube> "firefox --new-tab --search <search terms> " ?

If you use a dedicated search qube (or disposable qube) then it’s even
easier, as you only need to pass in the search terms.
But, I still don’t get it.

You want to type something - to get “search” or “search mode” - then type
in the search terms, hit enter, and read the results in a browser window
in a new qube.
Why don’t you just make a keyboard shortcut to open a browser in a new
qube at ddg? Then type in the search terms, hit enter, and read the
results. It’s the same number of key presses, and possibly a little
faster.
I must be missing something.

I am hoping to do something similar in rofi

Hi @stumpi would you agree that your original question has been answered
("How to run search in AppVm / DVM from dom0? ")?

The question that remains is if and how rofi can be customized to invoke
the qvm-run command. I suspect this is indeed possible, but maybe more
appropriately discussed at https://www.reddit.com/r/qtools/