Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open file through CLI? #1249

Closed
celsobenedetti opened this issue Feb 10, 2024 · 2 comments
Closed

Open file through CLI? #1249

celsobenedetti opened this issue Feb 10, 2024 · 2 comments
Labels
question Further information is requested

Comments

@celsobenedetti
Copy link

celsobenedetti commented Feb 10, 2024

Question:

I've installed Foliate through Flatpak, and I'm failing to open files from the CLI.
I've tried the following approaches, and all result in the app opening, but "Book cannot be opened - file not found".

flatpak run com.github.johnfactotum.Foliate "/home/me/book.epub"
flatpak run --file-forwarding   com.github.johnfactotum.Foliate "/home/me/book.epub"
echo "/home/me/book.epub" | xargs flatpak run  --file-forwarding  com.github.johnfactotum.Foliate
echo "/home/me/book.epub" | xargs flatpak run com.github.johnfactotum.Foliate 

Thank you!

Version:

  • Foliate version: 3.1.0
  • OS/Distribution and version: Pop!_OS 22.04 LTS x86_64
  • Desktop environment: GNOME 42.6
  • Installation method: Flatpak
@celsobenedetti celsobenedetti added the question Further information is requested label Feb 10, 2024
@johnfactotum
Copy link
Owner

From the documentation:

--file-forwarding

If this option is specified, the remaining arguments are scanned, and all arguments that are enclosed between a pair of @@ arguments are interpreted as file paths, exported in the document store, and passed to the command in the form of the resulting document path. Arguments between @@u and @@ are considered uris, and any file: uris are exported. The exports are non-persistent and with read and write permissions for the application.

So

flatpak run --file-forwarding com.github.johnfactotum.Foliate @@ "/home/me/book.epub" @@

@celsobenedetti
Copy link
Author

Works great. Thank you for the awesome tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants