Skip to content

Instantly share code, notes, and snippets.

@hrchu
Created January 26, 2016 08:38
Show Gist options
  • Save hrchu/dbf2b88e4ea2ac747d91 to your computer and use it in GitHub Desktop.
Save hrchu/dbf2b88e4ea2ac747d91 to your computer and use it in GitHub Desktop.
start google chrome in a new session, and import profile from origin
#!/bin/bash
# remove ':' from screen id
PROFILE="session${DISPLAY#:}"
PROFILE_DIRECTORY="$HOME/.google-chrome/$PROFILE"
mkdir -p $PROFILE_DIRECTORY
# import profile (includes bookmark) from origin
if [ ! -d "$PROFILE_PATH/Default" ]; then
cp -r $HOME/.config/google-chrome/Default $PROFILE_DIRECTORY/Default;
fi
google-chrome --user-data-dir=$HOME/.google-chrome/$PROFILE
@hrchu
Copy link
Author

hrchu commented Jan 26, 2016

@hrchu
Copy link
Author

hrchu commented Jan 26, 2016

My useful scenario: Have multiple x2go sessions with the same linux user. In this case, chrome cannot open in different x2go session. This script creates different profile for different session to solve the problem.

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