How to launch PWAs from the terminal (Microsoft Edge Apps / Chromium Apps)
I have websites such as Notion, Outlook, and Onedrive installed as Apps through the edge browser. I wanted to know if they can be launched using a command in the terminal.
I've used the following command to get the window class string
$ xprop -notype | grep -Eo '^(WM_CLASS|_NET_WM_NAME) = "[^"]*"'
which returns this for Notion:
_NET_WM_NAME = "Action Zone"
WM_CLASS = "crx__meenihjdjcobmkkapcdapdakmpbfpjeo"
And this for a normal edge tab:
_NET_WM_NAME = "New tab and 13 more pages - Personal - Microsoft​ Edge"
WM_CLASS = "microsoft-edge"
Now, while the command microsoft-edge
can be used in the terminal to launch it, crx__meenihjdjcobmkkapcdapdakmpbfpjeo
cannot. What do i need to do instead?
Solution 1:
I found out how to get this to work, for those wondering i'll post the solution below.
To find out which command you need, just
Navigate in edge to edge://apps/
- Right click on the desired app and select "Create Shortcuts"
- Create a shortcut to the desktop
- Open the shortcut using a text editor and extract the command. (Exec)
Now, using this command, you can execute the app directly from the terminal In my case I can do it by issuing the following command:
/opt/microsoft/msedge/microsoft-edge --profile-directory=Default --app-id=meenihjdjcobmkkapcdapdakmpbfpjeo --app-url=https://www.notion.so/Action-Zone-d7c525a18e4a453d9ba64c62505bf576