Skip to content

Instantly share code, notes, and snippets.

@ruario
Last active August 16, 2018 06:24
Show Gist options
  • Save ruario/17d0d312734da2e378837ab34c29abd9 to your computer and use it in GitHub Desktop.
Save ruario/17d0d312734da2e378837ab34c29abd9 to your computer and use it in GitHub Desktop.
How to assign a shortcut to launch Vivaldi in Standalone Mode on macOS

The following allows macOS users to run two different Vivaldi's alongside each other (e.g. stable and snapshot), with their prefences/settings stored seperately. This is also handy if you want to do an initial test of a snapshot in a self contained manor, without touching your main prefences/settings.

It works by causing launch Vivaldi in such a way that it stores its prefences/settings in a directory next it (called "Vivaldi Data"), rather than using the default prefences/settings directory ("~/Library/Application Support/Vivaldi").

To setup

  • Open the Automator.app (part of macOS) and create a new "Service"
  • Change "Service receives" to: "files or folders" in "Finder"
  • Drag "Get Selected Finder Items" (found under "Files & Folders") into the actions area
  • Drag "Run Shell Script" (found under "Utilities") into the actions area below "Get Selected Finder Items" and set "Pass input" to "as arguments"
  • Replace the example code with the following:
case "$1" in
  *Vivaldi.app) open -a "$1" --args --user-data-dir="${1%/*}/Vivaldi Data" ;;
esac
  • Save the Service workflow with an appropriate name, e.g. "Launch Vivaldi Standalone"
  • Open "System preferences → Keyboard settings → Shortcuts → Services"
  • Find your new Service (under "Files and Folders") and assign it an appropriate shortcut (e.g. ⌘S)

To use

You will need to do the following every time you wish to launch a copy of "Vivaldi.app" in Standalone Mode.

  • Click on Vivaldi.app once to select it
  • Issue the keyboard shortcut or select the service from the services menu

Known Issues

  • Autoupdate does not work well when Vivaldi is run in this way (on "Upgrade and Restart", your main prefences/settings will get used)—when you receive the upgrade notification, go to vivaldi.com (or vivaldi.net for snapshots) and download the new version, extract it from the dmg, shut down Vivaldi and then overwite the old version locally.
@ruario
Copy link
Author

ruario commented Nov 26, 2016

If you want to be able to start other Chromium based browsers in this way, adjust the code above as follows:

case "$1" in
  *Chrome*app|*Chromium.app|*Opera*app|*Vivaldi.app) open -a "$1" --args --user-data-dir="${1%/*}/Browser Data" ;;
esac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment