We want to be able to start a Chrome session with the profile of a particular user
cat /Users/${USER}/Library/Application\ Support/Google/Chrome/Local\ State |
jq -r ' .profile.info_cache | . '
This will output the whole json data for user profiles. We want to get only the profile name for "banned-from-urgent":
cat /Users/${USER}/Library/Application\ Support/Google/Chrome/Local\ State |
jq -r ' .profile.info_cache | to_entries|map(.key +": " + .value.name)|.[]' |
sort -k2,2n
The second one will output something like:
Profile 4: proto-mullet
Profile 5: Bob Wickham
Profile 6: okta developer account
Profile 9: Mona
Profile 11: Pip Crispy
Profile 12: Person 1
Profile 13: banned-from-urgent
Profile 14: Robin of Loxley
Profile 15: Roger de Courcey
Profile 16: Grillpan Eddie
Profile 17: Monty Bojangles
Profile 19: pet-ghes
You can then start a Chrome Browser with that profile number (this one would get me a session for "banned-from-urgent":
open -n -a "Google Chrome" --args --profile-directory="Profile 13" "http://$H"·