Add start_chrome_for which starts chrome profile for the provided email

This commit is contained in:
Ivan Malison 2021-08-20 19:56:26 -06:00
parent 6b25eb24fb
commit dc4d385013
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,8 @@
#!/usr/bin/env sh
function get_chrome_folder_from_address {
cat ~/.config/google-chrome/Local\ State |
jq -r ".profile.info_cache | to_entries | .[] | select(.value.user_name == \"$1\") | .key"
}
get_chrome_folder_from_address "$@"

View File

@ -0,0 +1,9 @@
#!/usr/bin/env sh
function start_chrome_for {
email=$1
shift
google-chrome-stable --profile-directory="$(get_chrome_folder_from_address "$email")" "$@"
}
start_chrome_for "$@"