On 2018-05-05 20:44, [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.
>
> 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 }'`
>
> 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
>
> Unfortunately this doesn't work. Can somone point me into the right direction?
> What is the right approach to run certain commands based on the fact that a 
> program is running or not?
>
> Sorry for this off-topic question but playing with Qubes gives so much 
> options for building own scripts and I am still a beginner here.
>
> [799]
>
You are probably better off writing something that will sync two
different .sqlite files by using SQL operations on both.  SQLite files
are safe to be accessed by two different programs at the same time, and
therefore you may not need to kill Firefox.

-- 
    Rudd-O
    http://rudd-o.com/

-- 
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/31c51383-57c4-86f9-c0db-91b0dc8ccbf0%40rudd-o.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to