i was interested in Bookmarks and Bookmarks.bak, but it didn't exactly fit with the other thread i was posting in: https://forum.vivaldi.net/topic/5009/export-notes-for-sharing/7. i was able to transfer files between computers fine. also works in deb/rpm or stable/snapshot. the files are located:
*.bak created after first run of browser, before initial setup. ~/.config/vivaldi/default/Bookmarks present after installation. can anyone confirm that this is html or not?
@monkey_wrench_gang898 - No, it's not. If you want HTML you need to export.
Are you just wanting to copy those two files from say a USB stick to your user's directory?
The bookmarks are stored in a file with JSON data format.
@cleverwise i was thinking email, but my script did use usb. location wouldn't matter, i just wanted option to sync bookmarks until vivaldi gets that down. i was told that bookmarks.bak was unnecessary and redundant. since it is missing on initial install, i am guessing it updates everytime the browser closes. although bookmarks are my priority for syncing, i am also trying to figure out panels, keyboard shortcuts, extensions. for the time being i manually copy ~/.config/vivaldi-snapshot/default/bookmarks* to a usb drive. modifications could also be added to script to apply to other developing browsers. my current script can only work if the username is edited into script. im trying to pipe $ whoami | [variable], but i need to get better at using variables.
Okay so you are looking at syncing rather than say restoring from a reinstall.
Restoring bookmarks from a system reinstall is very simple (could be placed in a restore/reinstall script):
mkdir -p ~/.config/vivaldi/Default/
cp /USB-DRIVE-MOUNT-POINT/Bookmarks* ~/.config/vivaldi/Default/
*However I give /home/ its own partition so reinstalling the distro is super easy as all user land data remains. I do this to all machines I maintain (even if system has network shares). *
As for syncing this really depends on where you want to sync... network drive(s)? Internet? sneaker net (USB)?
@cleverwise your post led me to a delightful definition article https://en.wikipedia.org/wiki/Sneakernet. my primary install script is for rpm systems, i only use vivaldi as non-administrator in linux or windows. while im in command line from installation, i cp bookmarks. same concept as your commands. i was going to sync through mailutils and email client, mailutils on system script to back up once per session. i would sync panels, extensions, keyboard shortcuts. i think it should be compatible json, i am unsure of the location. i have other experiments i am giving more effort to, might be a minute till i resume that one.
amethystrender is me on github, but i just started there. i know almost nothing about formal code creation and distribution and copyright/left.
i am trying to change your code for installing current vivaldi version to autodetect package manager. i am held up on syntax of recursive functions and variables. i am working through it. i could change the code from deb to rpm, but that doesn't seem as fun. it would be interesting to change script to sync other browsers as well (eg. qupzilla), but that would be too time consuming for how little i use others.
I would program the multi installer to just check for the existence of yum and dnf. Then set the variables of the file name and installer type. It is a pretty straight forward edit. I could probably get it done myself in the next day or so. I just need to find the few minutes to code it out.
As for the syncing situation it depends on how fast you want the changes to occur. If you want to keep this all in standard tools (avoiding things like Syncthing) then I would simply have a script fire off via cron every x time and rsync the changes to some directory (Internet, network drive, mounted USB stick, whatever).
Good deal on Sneaker Net. I have used that system a lot over my life.
@monkey_wrench_gang898 Okay I posted an update to the other thread with an updated file. The detecting yum or dnf was straight forward but I had to recode many parts as the repo URL changed. Also Vivaldi doesn't layout their deb and rpm repos the same.
They have both 32 and 64 bit deb installers in the same directory but for rpm they use two different ones. Go figure.
As for your copying issue you never replied with how fast you want the changed files to be copied over. Nor the destination.
i integrated your vivaldi install script in my own install script. used it twice, successfully on mint and korora. no problems. after initial start, extension install, i
cp /media/user/device/bookmarks ~/.config/vivaldi/Default/
i could do mkdir, cp ... during install, but speed dial retrieves snapshots and cookies, confuses me from understanding cookies and privacy badger. since script runs as root, i use browsers as standard user, media mounts to session user, i cant use whoami > $variable in script. maintaining username and file path is more inconvenient than copying file manually. for my command-line odyssey, can anyone think of a more interesting/elegant solution?
As for your copying question I would plug in media device before running your install/setup script.
Then add a line at the end to copy the bookmarks over.
Let's say /media/user/device/vivaldi/ (holds your Vivaldi data)
sudo mkdir -p ~/.config/vivaldi/Default/
sudo cp /media/user/device/vivaldi/* ~/.config/vivaldi/Default/
sudo chown user:group -R ~/.config/vivaldi/Default/
The first line will create the Default directory if it doesn't exist. The second will just copy any data in your vivaldi directory. This way you can put things other than just bookmarks. The third line will change the ownership to the user group you specify - CHANGE THIS!
If you look things like cookies, history, sessions, and tabs can be copied too. I am not sure all you want to copy over.
Will it ever be a future option for Vi to directly import all Opera configurations and bookmarks?
@cleverwise , im getting better at variables, so i was going to go at users from that angle. your solution would only work half the time, since i am not always on debian systems, not typically sudoer users. i know you can edit sudoers file, but i have limited experience changing system code. i was thinking
whoami | USER
cp -r /run/media/$USER/8*/vivaldi /home/$USER
although i am still learning syntax of variables. i was going to sync through dropbox, although onedrive is a doable alternative for settings/script location. i have not used syncthing or NAS with nextcloud, although they are fine alternatives.
@monkey_wrench_gang898 That is good to hear.
You technically don't need sudo. I often use it in setup scripts to get a desktop up and running as there are all kinds of things going on. Plus as sudo you can copy from any mounted filesystem (thus it avoids permission issues).
In Ubuntu based systems your starting user will have automatic sudo access setup by the system.
However the following would work too as long as you have access (permissions) to the mounted filesystem:
mkdir -p ~/.config/vivaldi/Default/
cp /media/user/device/vivaldi/* ~/.config/vivaldi/Default/
In that case sudo isn't needed and just runs as the user. I, again, often run one or two setup scripts that install 18ish programs, update the system, get swapfiles going etc. I tried to keep things in one or two runs.
In reality NOT using sudo (or root) where possible is better security.
Variables are pretty easy to set.
VARIABLE_NAME="data to hold"
To call it:
The best way to learn is look over others' code, like my Vivaldi install script. Also keep in mind there is usually two, three,... ten ways to accomplish something in programming. I would never claim my Vivaldi install script is perfect, the only way, or couldn't use some tweaks. That is scripting/programming.
I personally would avoid Dropbox, if possible, as it is a security nightmare. However I understand if all you can really do right now is that solution. If so well that is what you have to work with at this point.
i liked your script. i could understand it without needing to look anything up. i tend to overuse wget rather than curl. until recently i've been running installation scripts as root. because it's easy. for debian, using sudo in the script works better than rpm. i chose dropbox: deb, rpm, windows support. i have 10+ character password, alphanumeric + capitals & special characters. and 2-factor authentication. im not excessively worried about security. for purposes of scripting, it could be any storage mapped to a system directory. i was thinking:
whoami | USER
if [$USER == "root"]
cp -R /home/$USER/.config/vivaldi /home/$USER/Dropbox/
and in your install script i would add
mkdir -p ~/.config/vivaldi
cp -R ~/Dropbox/vivaldi ~/.config
i've never changed anything other than DNS in system files before. i suppose once i learn rPI nextcloud i could just always map ~/.config/vivaldi to NAS during installation. that goal is much learning away, but it would sync after installation. or i could
ln -s ~/.config/vivaldi ~/Dropbox/vivaldi
windows automatically maps dropbox and onedrive, so windows solution could be similar. i will try symbolic linking on my next virtual machine. i wish onedrive had a linux client. looking arount in /etc/c* i found a link to /opt/vivaldi/cron/vivaldi. vivaldi update script. it features pgp signatures. that answers my question six months ago about how it authenticates updates.
I used to use wget too but curl offers better security and is recommended for this reason.
It looks like you have a good layout; something to build on. I would use a symbolic link myself for several reasons. So your thoughts there are what I would do given the parameters you have supplied.
As for not being concern Dropbox has experienced some serious security flaws including the ability for anyone to modify files. I would be mindful that you are going to allow this code to be used by your machines and if someone modifies the data... Well that could lead to problems. It is something to think about at any rate.
However I am still not clear on the setup. If you use the machines one at a time fine. Still if two or more machines are in use and trying to update the files that could be an issue. One machine could overwrite another.
This is where things like Nextcloud come in handy.
with a little legwork, i can sync bookmarks between vivaldi installs w/o problems. copying the whole settings folder is too large and recursive to be practical. syncing extensions over the cloud makes me hesitate over security concerns until i figure out NAS. looking in ~/.config/vivaldi/Default/E*, how would i be able to selectively copy certain extensions (UBO, ghostery, translate this!, https everywhere, pocket, pocket app, evernote app).
most dropbox exploits i found were for authentication tokens and shared files. Dropbox works for bookmarks at least. i compiled github nextcloud, still trying to figure it out. my password manager is the only big red light on me experimenting syncing extensions.
@monkey_wrench_gang898 If you have Dropbox mounting to your filesystem then you could simply rsync the items in question while excluding directories or files you don't want.