Skip to content

Instantly share code, notes, and snippets.

@penryu
Created April 7, 2023 13:39
Show Gist options
  • Save penryu/1231e5344b9abfb8f1620c051bea1425 to your computer and use it in GitHub Desktop.
Save penryu/1231e5344b9abfb8f1620c051bea1425 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Open Chrome in profile depending on the name it's invoked as.
# Echo URL regardless of profile
echo "${url:=$1}"
# Select profile by binary name.
# If invoked as..... Open in profile...
# wopen work
# gopen home
# <anything else> default
case $(basename "$0") in
# personal
gopen) profile="penryu@gmail.com" ;;
# work
wopen) profile="t.hammerquist@opendrives.com" ;;
# default
*) profile="penryu@gmail.com" ;;
esac
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
"--profile-email=$profile" "$url" >/dev/null
@penryu
Copy link
Author

penryu commented Apr 7, 2023

$ ln -s gopen wopen
$ export BROWSER="wopen:echo"

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