diff --git a/dotfiles/lib/functions/get_chrome_folder_from_address b/dotfiles/lib/functions/get_chrome_folder_from_address new file mode 100755 index 00000000..8065296e --- /dev/null +++ b/dotfiles/lib/functions/get_chrome_folder_from_address @@ -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 "$@" diff --git a/dotfiles/lib/functions/start_chrome_for b/dotfiles/lib/functions/start_chrome_for new file mode 100755 index 00000000..31a78f62 --- /dev/null +++ b/dotfiles/lib/functions/start_chrome_for @@ -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 "$@"