How do I open files with flatpak okular from command line?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have an alias for okular installed with flatpak that is set up like this:



alias okular="org.kde.okular"



It opens up okular from the terminal. However if I try to open a file from the terminal with that alias e.g:



okular document.pdf



Then it doesn't work. What am I doing wrong?



Is there a way to open a file in the terminal using okular flatpak, rather than using the GUI?



update:



So I found this link:




--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.




Surely this doesn't mean the only way to open files in the terminal using okular flatpak is to do something like this:



flatpak run okular.kde.org --file-forwarding @/home/user/documents/document.pdf@



I can't do this for every pdf I want to open. How can I add this as an alias so that I dont't need to type very long commands when opening different pdfs?







share|improve this question

























    up vote
    0
    down vote

    favorite












    I have an alias for okular installed with flatpak that is set up like this:



    alias okular="org.kde.okular"



    It opens up okular from the terminal. However if I try to open a file from the terminal with that alias e.g:



    okular document.pdf



    Then it doesn't work. What am I doing wrong?



    Is there a way to open a file in the terminal using okular flatpak, rather than using the GUI?



    update:



    So I found this link:




    --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.




    Surely this doesn't mean the only way to open files in the terminal using okular flatpak is to do something like this:



    flatpak run okular.kde.org --file-forwarding @/home/user/documents/document.pdf@



    I can't do this for every pdf I want to open. How can I add this as an alias so that I dont't need to type very long commands when opening different pdfs?







    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have an alias for okular installed with flatpak that is set up like this:



      alias okular="org.kde.okular"



      It opens up okular from the terminal. However if I try to open a file from the terminal with that alias e.g:



      okular document.pdf



      Then it doesn't work. What am I doing wrong?



      Is there a way to open a file in the terminal using okular flatpak, rather than using the GUI?



      update:



      So I found this link:




      --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.




      Surely this doesn't mean the only way to open files in the terminal using okular flatpak is to do something like this:



      flatpak run okular.kde.org --file-forwarding @/home/user/documents/document.pdf@



      I can't do this for every pdf I want to open. How can I add this as an alias so that I dont't need to type very long commands when opening different pdfs?







      share|improve this question













      I have an alias for okular installed with flatpak that is set up like this:



      alias okular="org.kde.okular"



      It opens up okular from the terminal. However if I try to open a file from the terminal with that alias e.g:



      okular document.pdf



      Then it doesn't work. What am I doing wrong?



      Is there a way to open a file in the terminal using okular flatpak, rather than using the GUI?



      update:



      So I found this link:




      --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.




      Surely this doesn't mean the only way to open files in the terminal using okular flatpak is to do something like this:



      flatpak run okular.kde.org --file-forwarding @/home/user/documents/document.pdf@



      I can't do this for every pdf I want to open. How can I add this as an alias so that I dont't need to type very long commands when opening different pdfs?









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jun 21 at 14:31
























      asked Jun 21 at 13:49









      MyWrathAcademia

      1409




      1409

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f451113%2fhow-do-i-open-files-with-flatpak-okular-from-command-line%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f451113%2fhow-do-i-open-files-with-flatpak-okular-from-command-line%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay