3

Can you make a chrome application default to open files in pantheon?

I would like to set .txt files to open a application called "text" which is a chrome application.

  • 1
    There's a way to call a arbitrary application on the "Open with" menu. Take a look in this answer: elementaryos.stackexchange.com/a/2109/2461 BUT I don't know if you can pass a file (local path) to a chrome application as it is, after all, a webpage. – Thiago Jedi Oct 29 '15 at 2:13
2

You can, as in the example below (I used Google Docs as I do not have the other app but it should work exactly in the same way).

  1. Install the chrome app in question in the application menu (right-click and Create shortcuts… in Chrome Apps tab). For me it created the file ~/.local/share/applications/chrome-aohghmighlieiainnegkcijnfilokake-Default.desktop, find the .desktop that corresponds to your Chrome App.
  2. Append %F with a text editor in the Exec= line (see below):

    #!/usr/bin/env xdg-open
    [Desktop Entry]
    Version=1.0
    Terminal=false
    Type=Application
    Name=Google Docs
    Exec=/opt/google/chrome/google-chrome --profile-directory=Default --app-id=aohghmighlieiainnegkcijnfilokake %F
    Icon=chrome-aohghmighlieiainnegkcijnfilokake-Default
    StartupWMClass=crx_aohghmighlieiainnegkcijnfilokake
    
  3. Right-click on the file you want to open in Files, select Open with, look for you application and assign it as default (or leave it as an option in the context menu, as wanted).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.