Skip to content

Instantly share code, notes, and snippets.

@hrchu
Created January 26, 2016 08:38
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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