How do i create a keyboard shortcut to open a chrome app or web page? How to do it from the command line?
2 Answers
Open URL from command line:
google-chrome http://www.example.com
Open URL as application from command line:
google-chrome --app=http://www.example.com
Create keyboard shortcut for opening URL:
System Settings > Keyboard > Shortcuts > Custom > +
- Name: Foo
- Command: google-chrome http://www.example.com
- Press Apply
- Select the new row, then press and hold down the desired keys
Create keyboard shortcut for opening URL as application:
System Settings > Keyboard > Shortcuts > Custom > +
- Name: Bar
- Command: google-chrome --app=http://www.example.com
- Press Apply
- Select the new row, then press and hold down the desired keys

- 594
Find your chrome app shortcuts files at: ~/.local/share/applications
You will find there a list of *.desktop
files. In the inside they will look something like this:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Google Drive
Exec=/opt/google/chrome/google-chrome %U --profile-directory=Default --app-id=apdfllckaasghufndbhieahigkjlhiii
Icon=chrome-apdfllckaasghufndbhieahigkjlhiii-Default
NoDisplay=true
StartupWMClass=crx_apdfllckaasghufndbhieahigkjlhiii
Copy that exec command to your shortcut command.
/opt/google/chrome/google-chrome --profile-directory=Default --app-id=apdfllckaasghufndbhieahigkjlhiii
credit to @Jacob Vlijm

- 836
~/.local/share/applications
, your app is represented by a .desktop file. Please post the content of the file's Exec= -line – Jacob Vlijm Mar 22 '17 at 11:58cat file.desktop
– Jacob Vlijm Mar 22 '17 at 13:07