DEV Community

HaxNet
HaxNet

Posted on

3

How to run Google Chrome Apps via Command Line (CLI)

So I use ArchLinux on my Home PC and my Work PC. I use Google Chrome for work as a default browser and at home I use QuteBrowser. Sometimes, Google Chrome has the ability to just install Chrome Apps instead of downloading Electron and Nativefier to create your own.

So for instance, I like to use this Spike email as my email client but they do not have it for Linux. A great alternative it is install it as an App in Google Chrome.

Once I install it. I would go to my terminal and create an alias

First if you have multiple Profiles in Chrome, you would need to find out which profile it is and it is by the Number. Ex. Profile 1, Profile 2, Profile 3 and so on.

I will show you how my alias looks first. You can add this to your fish config, your zsh or bash. I did it for my fish config

[I] ┌──[archlinux] as haxnet in ~/.config/fish on (master ↓7 ✚10)
└──▶ cat config.fish | grep spike



alias spike='/usr/bin/google-chrome-stable --profile-director="Profile 3" --app-id=emldofgbopmlaimkbbfnionhnagimknj & disown'


Enter fullscreen mode Exit fullscreen mode

Image description

You need to figure out where is your google chrome executable file is. In my case, it is /usr/bin/google-chrome-stable (btw, you can do this with chromium)

Now you would select your Profile. How to find this you can go to google chrome and find your installed app settings

Image description

Click on the menu and go to app info>setting

Image description

The url where I highlighted is your AppID this is where you put in the command line in the terminal as --app-id=AppID

Copy that appID and then go to your terminal and locate the appID

[I] ┌──[archlinux] as haxnet in ~ on (master ↓7 ✚10)
└──▶ locate emldofgbo | grep Profile

/home/haxnet/.local/share/icons/hicolor/128x128/apps/chrome-emldofgbopmlaimkbbfnionhnagimknj Profile_3.png
/home/haxnet/.local/share/icons/hicolor/256x256/apps/chrome-emldofgbopmlaimkbbfnionhnagimknj Profile_3.png
/home/haxnet/.local/share/icons/hicolor/32x32/apps/chrome-emldofgbopmlaimkbbfnionhnagimknj-Profile_3.png
/home/haxnet/.local/share/icons/hicolor/48x48/apps/chrome-emldofgbopmlaimkbbfnionhnagimknj-Profile_3.png
/home/haxnet/.local/share/icons/hicolor/512x512/apps/chrome-emldofgbopmlaimkbbfnionhnagimknj Profile_3.png
/home/haxnet/Desktop/chrome-emldofgbopmlaimkbbfnionhnagimknj-Profile_3.desktop

You will quickly see the results and for me, it is Profile 3

that's where you put --profile-director="Profile 3"

I just add the & disown to basically run it as a standalone so I can continue using the same terminal.

for the locate function - you will need to download mlocate

You can read my other post about this function

dev.to/haxnet/locate

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more