/home/amgsk

Google Chromeを特定のプロファイルで起動する

· updatedAt: 2026/02/15 · amgsk

Google Chromeを特定のユーザープロファイルで直接起動する方法について紹介する。
複数のプロファイルを使い分けている場合は便利と思う。 自分は仕事用やプライベート用それぞれで10個くらいのプロファイルを使用していて、作業によって切り替えたりしている。

  • プロジェクトN用のインフラ作業用(本番向け、STG向け)
  • プロジェクトごとのテストアカウントA~Z
  • プライベート用

このプロファイルの切り替えが微妙に面倒に感じていた。
スクロールの量も増えてきていて、プロファイル選択で数秒掛かってしまっていた。

以下のようにコマンドで起動すれば、指定したプロファイルでChromeを起動できる。
既にそのプロファイルでタブが開かれていた場合でも、新しくウィンドウを開くような挙動となり、既存のプロファイルのウィンドウにフォーカスが飛ばなくなるので使いやすくもなる。

つまり以下を特定のキーバインドで実行させてやればマウス操作は不要でストレスフリーというわけ。

1
2
3
4
google-chrome-stable --profile-directory="Default"
google-chrome-stable --profile-directory="Profile 1"
google-chrome-stable --profile-directory="Profile N"
google-chrome-stable --guest # ゲストモード

プロファイルの確認方法

Profiles

そのプロファイルで起動して、chrome://versionを開く。
Profile Pathに記載してあるディレクトリがそれ。

ちなみに、他のプロファイルも~/.config/google-chrome/配下のディレクトリ名にあるが、このディレクトリ内のファイルを見てもプロファイル名を導き出すことは難しかった。メンドイけど一つ一つ確認するしかなさそう。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
amgsk@arch-desk ~/d/m/blog (main)> ls ~/.config/google-chrome/ | grep "^\(Default\|Profile\)"
Default
Profile 1
Profile 10
Profile 11
Profile 12
Profile 2
Profile 3
Profile 5
Profile 6
Profile 7
Profile 8
Profile 9

Preferences.nameというそれっぽい値を抽出してみたが求めている情報とは違った。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
for d in ~/.config/google-chrome/{Default,Profile*}; do 
  name=$(jq -r '.profile.name' "$d/Preferences"); 
  echo "$d: $name"; 
done

# > /home/amgsk/.config/google-chrome/Default: Person 1
# > /home/amgsk/.config/google-chrome/Profile 1: Person 1
# > /home/amgsk/.config/google-chrome/Profile 2: Person 1
# > /home/amgsk/.config/google-chrome/Profile 3: Person 1
# > /home/amgsk/.config/google-chrome/Profile 4: Person 1
# ...

i3wmでプロファイルを指定して開くバインドの例

モードを活用し、プロファイル選択モードを作るのがオススメ。以下の例では一連の操作を行っている。

  • $mod+cでプロファイルの入力を待ち受けるモードになる
  • [a-z]に対してキーを割り当てている。キーが押されたらそのプロファイルで起動する
  • ノーマルモードへ移行する
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
mode 'Chrome Profile' {
  bindsym a exec --no-startup-id google-chrome-stable --profile-directory="Default", mode "default"
  bindsym b exec --no-startup-id google-chrome-stable --profile-directory="Profile 1", mode "default"
  bindsym c exec --no-startup-id google-chrome-stable --profile-directory="Profile 2", mode "default"
  bindsym d exec --no-startup-id google-chrome-stable --profile-directory="Profile 3", mode "default"
  bindsym e exec --no-startup-id google-chrome-stable --profile-directory="Profile 4", mode "default"
  bindsym f exec --no-startup-id google-chrome-stable --profile-directory="Profile 5", mode "default"
  bindsym g exec --no-startup-id google-chrome-stable --profile-directory="Profile 6", mode "default"
  # ...
  bindsym z exec --no-startup-id google-chrome-stable --guest, mode "default"

  # Back to Normal Mode
  bindsym Escape mode "default"
}
# Enter profile selection mode
bindsym $mod+c exec --no-startup-id mode "default", mode 'Chrome Profile'

(追記) hyprlandでプロファイルを指定して開くバインドの例

1
2
3
4
bind = Alt, a, exec, google-chrome-stable --profile-directory="Default"
bind = Alt, s, exec, google-chrome-stable --profile-directory="Profile 1"
bind = Alt, d, exec, google-chrome-stable --profile-directory="Profile 2"
bind = Alt, f, exec, google-chrome-stable --profile-directory="Profile 3"

今日はこんな感じで。