Open up multiple PWA using the google-chrome cli option

Viewed 1353

I wanted to open multiple PWA's (Progressive Web Apps) like Twitter, Google-Keep, and Youtube Music at the StartUp of Ubuntu.

There are particular app-id for each of the above sites, which are located as a folder at ~/.config/google-chrome/Default/Extensions/

Twitter        - jgeocpdicgmkeemopbanhokmhcgcflmi
Google Keep    - hmjkmjkepdijhoojdojkdfohbdgmmhki
YouTube Music  - cinhimbnkkaeohfgghhklpknlkffjgod

So currently, to open these three PWA's at startup, I need to use three different CLI commands like the below at Ubuntu's Startup Application Preferences

/usr/bin/google-chrome --profile-directory=Default --app-id=jgeocpdicgmkeemopbanhokmhcgcflmi
/usr/bin/google-chrome --profile-directory=Default --app-id=hmjkmjkepdijhoojdojkdfohbdgmmhki
/usr/bin/google-chrome --profile-directory=Default --app-id=cinhimbnkkaeohfgghhklpknlkffjgod

How do I combine the above three commands to present an array of app-ids? I couldn't find anything in the man pages as well.

Is there any documentation related to the above?

Asked a similar question @here

1 Answers

Posted on your similar question...

The following code is modified from code based on this site's example.

For your shell script

for appid in "$@" 
do
    /usr/bin/google-chrome --profile-directory=Default --app-id=$appid &;
done

The command to call it

sh my-script.sh jgeocpdicgmkeemopbanhokmhcgcflmi hmjkmjkepdijhoojdojkdfohbdgmmhki

Further Ideas

Have a configuration file that houses the IDs you want to open, and use the shell script to loop through the IDs in the config as opposed to the command line arguments.

Related