Hello Ivan,

sorry for top-posting, but as everything you mentioned is super interesting
and very helpful ... Thank you!

The auto export bookmarks feature is nice, didn't know that and if
places.sqlite also includes the browser history I will not use the "copy
places.sqlite file"-approach, because one reason why I am using a
disposable AppVM is exactly because I don't want to have my history seen.

So the only task is to qvm-copy the latest auto-bookmarks export file into
the right location on the dispvm.
There is one problem (maybe):
I need to check if a firefox profile folder exists in the disposable VM.
Not sure if this is the case as each disposable VM is a "fresh" one.

Thanks again for your scripting tips - this is why I love the Qubes
Community :-)

[799]


Ivan Mitev <i...@maa.bz> schrieb am Mo., 7. Mai 2018, 07:28:

> Hi,
>
> On 05/05/2018 11:44 PM, [799] wrote:
> > Hello,
> >
> > following a recent discussion in the qubes-community github repository,
> Ivan has written an interesting script for handling links and disposable
> VMs.
> > This has inspired me to look how to move firefox bookmarks to other
> AppVMs.
> > While disposable VMs are great, sometimes it is handy to have bookmarks
> available in an AppVM.
> >
> > I was able to import bookmarks into other Appvms by transfering the
> places.sqlite file which holds the bookmarks.
>
> Interestingly I investigated this a few weeks ago; an alternative to
> copying the sqlite file (or using sql commands as suggested by rudd-o)
> is to automatically import/export bookmarks as an html file. See:
>
> https://support.mozilla.org/en-US/questions/928809#answer-338913
>
> you shouldn't need to delete the sqlite file in the target VM if you set
> this:
>
> http://kb.mozillazine.org/Browser.places.importBookmarksHTML
>
> The bookmark format looks straightforward so it should be possible to
> merge two html files with basic commands (sed/grep/awk/...) before
> importing. But you might be better off using buku
> (https://github.com/jarun/Buku) to import bookmarks, and then export
> them ; it's quite powerful...
>
>
>
> > In the target AppVM which has the bookmarks:
> > qvm-copy-to-vm <AppVMdestination>
> /home/user/.mozilla/firefox/*.default/places.sqlite
> >
> > then in the destination VM you only need to move the file from
> QubesIncoming to the profile path.
> > While this works, I like to add some error checking and I would also
> like to kill a running firefox in the destination AppVM.
> >
> > I was able to kill firefox running:
> >
> >    kill `ps -A | grep firefox | gawk '{ print $1 }'`
>
> you could also use `pkill firefox`
>
> >
> > no I tried to run further command based on the fact if firefox is
> running or not.
> > I thereof tried to do something like this:
> >
> > if [`ps -A | grep firefox | gawk '{ print $1 }'` \> 0]; then
> >    echo "Run this when PID is > 0 and thereof Firefox is running"
> > else
> >    echo "Run this when firefox is not running"
> > fi
>
> The problem when using 'grep' is that 'ps' may output the 'grep' line
> itself so even if the process doesn't exist you'll get a match; eg.
>
> $ ps aux | grep nosuchprocess
>
> user      6837  [..] grep --color=auto nosuchprocess
>
> (although 'ps -A' doesn't seem to have this behavior)
>
> to avoid that, a trick is to use a regex like that:
>
> if ps -A | grep -q [f]irefox; then ...
>
> alternatives:
>
> if pgrep firefox > /dev/null; then ...
> if [ -n "$(pgrep firefox)" ]; then ...
> if [ -n "$(pidof firefox)" ]; then ...
>
> and as a side note you can use a short 'if' construct like that if you
> have only short commands:
>
> [ -n "$(pgrep firefox)" ] && echo running || echo not running
>

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/CAJ3yz2tUzwfmdKgeOsqogXvDU2%2Bhz2beykhNEGgQEnCGRsJ%3Drg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to