Skip to content

Instantly share code, notes, and snippets.

@sainak
Last active June 26, 2022 16:59
Show Gist options
  • Save sainak/985999aae6390e64410ec397e84f60fd to your computer and use it in GitHub Desktop.
Save sainak/985999aae6390e64410ec397e84f60fd to your computer and use it in GitHub Desktop.
pacman hook to update the default chrome desktop entry with custom profiles

pacman hook to update the default chrome desktop entry with custom profiles

To see the available profiles run:

cat ~/.config/google-chrome/Local\ State  | jq .profile

Paste the hook in /etc/pacman.d/hooks/google-chrome-shortcut-patch.hook

[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Target = google-chrome
[Action]
Description = Patching Chrome desktop shortcut...
When = PostTransaction
Exec = /usr/bin/bash -c "/usr/bin/curl https://gist.githubusercontent.com/sainAk/985999aae6390e64410ec397e84f60fd/raw/google-chrome.desktop | tee /usr/share/applications/google-chrome.desktop"
[Desktop Entry]
Version=1.0
Name=Google Chrome
GenericName=Web Browser
Comment=Access the Internet
StartupWMClass=Google-chrome
Exec=/usr/bin/google-chrome-stable --profile-directory="Default" %U
StartupNotify=true
Terminal=false
Icon=google-chrome
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
Actions=new-window-picker;new-window-personal;new-window-blank;new-private-window;
[Desktop Action new-window-picker]
Name=New Window Picker
StartupWMClass=Google-chrome
Exec=/usr/bin/google-chrome-stable %U
[Desktop Action new-window-personal]
Name=Personal
StartupWMClass=Google-chrome
Exec=/usr/bin/google-chrome-stable --profile-directory="Default"
[Desktop Action new-window-blank]
Name=blank
StartupWMClass=Google-chrome
Exec=/usr/bin/google-chrome-stable --profile-directory="Profile 3"
[Desktop Action new-private-window]
Name=New Incognito Window
StartupWMClass=Google-chrome
Exec=/usr/bin/google-chrome-stable --incognito
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment