# PCManFM: Open and save files with Onlyoffice?

**URL:** <https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490>\
**Category:** Applications\
**Created:** [January 25, 2023, 10:53am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490 "2023-01-25T10:53:07Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![LamnaNasus](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/lamnanasus/32/10804_2.png) [@LamnaNasus](https://forum.endeavouros.com/u/LamnaNasus)\
**Post date:** [January 25, 2023, 2:53pm UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/21 "2023-01-25T14:53:04Z")

</div>

And a last test:

Mabox uses PCManFM by default. I figured they, as distro makers, should know how to configure this correctly.

I installed Mabox in a vm, and installed Onlyoffice. Result: same pcmanfm + onlyoffice problem as on my home-made Arch Fluxbox.

Preliminary conclusion, based on very little knowledge on the matter:

there is some weird mime -type thing going on with PCmanFM, that happens even on official distros. Or that Onlyoffice and PCManFM just aren’t and cannot be friends.

---

<div class="post-metadata">

**Author:** ![LamnaNasus](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/lamnanasus/32/10804_2.png) [@LamnaNasus](https://forum.endeavouros.com/u/LamnaNasus)\
**Post date:** [January 27, 2023, 9:08am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/22 "2023-01-27T09:08:59Z")

</div>

It seems like I am closer to a solution to this debacle.

This seems to be an Onlyoffice issue, and PCmanFM and the mime stuff looks to be blameless.

In the Onlyofffice support forum, this guy had the exact same problem:

> <https://github.com/ONLYOFFICE/DesktopEditors/issues/872>
>
> \### This issue is unique.
> 
> \- \[X\] I have used the \[search tool\](https://github.co…m/ONLYOFFICE/DesktopEditors/issues?q=) and did not find an issue describing my bug.
> 
> \### Operating System
> 
> Linux (DEB package)
> 
> \### Version information
> 
> 7.0.1.37
> 
> \### Expected Behavior
> 
> If I am in some directory, I expect \`onlyoffice-desktopeditors myfile.docx\` to open it.
> 
> \### Actual Behavior
> 
> It doesn't work with relative path, but \`onlyoffice-desktopeditors "$(realpath myfile.docx)"\` works as expected.
> 
> \### Reproduction Steps
> 
> In a terminal, run \`onlyoffice-desktopeditors myfile.docx\`, onlyoffice opens on the welcome screen.
> In a terminal, run \`onlyoffice-desktopeditors /path/to/myfile.docx\`, onlyoffice is now able to directly open the file.
> 
> \### Additional information
> 
> I tried it on ArchLinux, then I also tried the flatpak package and the behavior is the same, probably with the other platforms/packaging systems too.
> 
> I fixed it with a script that automatically changes any file arguments by its real path:
> 
> \`\`\`sh
> \#!/bin/sh
> 
> for argv; do
> if \[-f "$argv" \]; then
> argv="$(realpath "$argv")"
> fi
> set -- "$@" "$argv"
> shift
> done
> 
> exec /opt/onlyoffice/desktopeditors/DesktopEditors "$@"
> \# or
> \# exec flatpak run org.onlyofficedesktopeditors "$@"
> \`\`\`

I can reproduce the results exactly on my computer.

If I create a `test.docx` file (made with MS office, with some text in it) in my downloads folder, open a terminal in that folder and run

`onlyoffice-desktopeditors test.docx`

Onlyoffice will just open the welcome screen.

But if I run with the full file path from the terminal:

`onlyoffice-desktopeditors /home/vlad/Downloads/test.docx`

Onlyoffice opens the file exactly as it should. The text is showing, it is not an empty document. The same goes for excel files and powerpoint files.

So Onlyoffice needs the full and explicit path, to open files correctly in PCManFM, but not in Thunar.

This guy “fixed” it with a script, as a workaround:

```auto
#!/bin/sh

for argv; do
    if [-f "$argv"]; then
        argv="$(realpath "$argv")"
    fi
    set -- "$@" "$argv"
    shift
done

exec /opt/onlyoffice/desktopeditors/DesktopEditors "$@"
# or
# exec flatpak run org.onlyofficedesktopeditors "$@"

```

So my question is:

How can I reproduce this on my computer, and use this script this person made?

I’ve been playing around with some simple ready-made scripts, with some success. But I dont know how to set this up with PCManFM, so that it will always open office files with the full path.

---

<div class="post-metadata">

**Author:** ![ringo](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ringo/32/66182_2.png) [@ringo](https://forum.endeavouros.com/u/ringo)\
**Post date:** [January 27, 2023, 9:35am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/23 "2023-01-27T09:35:55Z")

</div>

is xdg-desktop-portal-gtk also in use ?

---

<div class="post-metadata">

**Author:** ![LamnaNasus](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/lamnanasus/32/10804_2.png) [@LamnaNasus](https://forum.endeavouros.com/u/LamnaNasus)\
**Post date:** [January 27, 2023, 9:44am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/24 "2023-01-27T09:44:33Z")

</div>

I’m still in the very early stages of understanding the xdg stuff.

How do I check that? It is installed, but I don’t know if it is set up correctly.

---

<div class="post-metadata">

**Author:** ![ringo](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ringo/32/66182_2.png) [@ringo](https://forum.endeavouros.com/u/ringo)\
**Post date:** [January 27, 2023, 9:47am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/25 "2023-01-27T09:47:29Z")

</div>

i saw you have a bit of flatpak too… pcmanfm-qt example some parts is xdg-desktop-portal-lxqt ,

sorry i am a noob with this just came up with it… probably from the aur version not needed.

---

<div class="post-metadata">

**Author:** ![LamnaNasus](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/lamnanasus/32/10804_2.png) [@LamnaNasus](https://forum.endeavouros.com/u/LamnaNasus)\
**Post date:** [January 27, 2023, 9:53am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/26 "2023-01-27T09:53:20Z")

</div>

Thanks. I’ve tested all the variations of PCManfm, gtk and qt, they all act the same.  
From what I can tell, this is more of an Onlyoffice issue than a PCManfm issue. But then, I’m basically a noob as well.

---

<div class="post-metadata">

**Author:** ![ringo](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ringo/32/66182_2.png) [@ringo](https://forum.endeavouros.com/u/ringo)\
**Post date:** [January 27, 2023, 10:01am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/27 "2023-01-27T10:01:56Z")

</div>

i only know xdg-desktop-portal (-gtk depend what you use) but straight aur is different offcourse never tried this office 🙂

---

<div class="post-metadata">

**Author:** ![LamnaNasus](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/lamnanasus/32/10804_2.png) [@LamnaNasus](https://forum.endeavouros.com/u/LamnaNasus)\
**Post date:** [January 27, 2023, 10:15am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/28 "2023-01-27T10:15:02Z")

</div>

Perhaps one aspect of the problem is that Onlyoffice seems to only have one executable, and then it decides internally how to open the file? I dunno. Somehow it works with Thunar but not PCManFm, not even on distros who use it by default.

But at least there seems to be a real and actual problem with Onlyoffice itself. From the terminal, it needs the exact and explicit path to open files correctly.

---

<div class="post-metadata">

**Author:** ![ringo](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ringo/32/66182_2.png) [@ringo](https://forum.endeavouros.com/u/ringo)\
**Post date:** [January 27, 2023, 10:36am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/29 "2023-01-27T10:36:00Z")

</div>

i checked with docx , right click i can select standard office this case onlyoffice , and a click it starts… but i use pcmanfm-qt

---

<div class="post-metadata">

**Author:** ![LamnaNasus](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/lamnanasus/32/10804_2.png) [@LamnaNasus](https://forum.endeavouros.com/u/LamnaNasus)\
**Post date:** [January 27, 2023, 10:45am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/30 "2023-01-27T10:45:08Z")

</div>

hmm…that does not work here.

If you write something, save it and open it again, does it open correctly with the new text?

---

<div class="post-metadata">

**Author:** ![ringo](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ringo/32/66182_2.png) [@ringo](https://forum.endeavouros.com/u/ringo)\
**Post date:** [January 28, 2023, 9:42am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/31 "2023-01-28T09:42:46Z")

</div>

So right click file preferences you dont have something to open standard with a standard editor?

---

<div class="post-metadata">

**Author:** ![LamnaNasus](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/lamnanasus/32/10804_2.png) [@LamnaNasus](https://forum.endeavouros.com/u/LamnaNasus)\
**Post date:** [January 28, 2023, 10:06am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/32 "2023-01-28T10:06:27Z")

</div>

Yes, I have. For the problem, see the posts above.

Onlyoffice installs and integrates with PCManFM. But when opening files, any office file, from within PCManFM, it just diplays an empty Onlyoffice word document.

When opening files from within Onlyoffice, with the file picker, it works as expected.

This also happens on the official EOS live iso, when I install PCmanFM and Onlyoffice on it. And on any distro I’ve tried (Garuda LxQt and Mabox) that has PCmanFM as the default file manager.

The beahvior is the same across PCManM versions. I’m very interested in knowing how you got it to work with PCManFM-QT.

---

<div class="post-metadata">

**Author:** ![ringo](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ringo/32/66182_2.png) [@ringo](https://forum.endeavouros.com/u/ringo)\
**Post date:** [January 28, 2023, 11:58am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/33 "2023-01-28T11:58:12Z")

</div>

not really … is general issue pcmanfm-XXX vs onlyoffice… in pcmanfm it want to start a new document even you called document1.docx it doesnt load… even an aliend .odt it creates a document1.docx … somehow not compatible

---

<div class="post-metadata">

**Author:** ![ringo](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ringo/32/66182_2.png) [@ringo](https://forum.endeavouros.com/u/ringo)\
**Post date:** [January 28, 2023, 11:58am UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/34 "2023-01-28T11:58:33Z")

</div>

it do start but it starts in new docs

---

<div class="post-metadata">

**Author:** ![LamnaNasus](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/lamnanasus/32/10804_2.png) [@LamnaNasus](https://forum.endeavouros.com/u/LamnaNasus)\
**Post date:** [January 28, 2023, 12:09pm UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/35 "2023-01-28T12:09:49Z")

</div>

I’m not good enough with scripts to use the workaround.

It seems possible to use it, so that when you click an office file in PCManFM, PCManFM will call that script and use it to open the file.

But it is beyond my skill level at this point in time.

---

<div class="post-metadata">

**Author:** ![ringo](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ringo/32/66182_2.png) [@ringo](https://forum.endeavouros.com/u/ringo)\
**Post date:** [January 28, 2023, 12:15pm UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/36 "2023-01-28T12:15:30Z")

</div>

tried this in openbox edition with pcmanfm-gtk3 and thunar, thunar seems to load fine while in pcmanfm always made a new document

---

<div class="post-metadata">

**Author:** ![LamnaNasus](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/lamnanasus/32/10804_2.png) [@LamnaNasus](https://forum.endeavouros.com/u/LamnaNasus)\
**Post date:** [January 28, 2023, 12:17pm UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/37 "2023-01-28T12:17:34Z")

</div>

Yes, see posts above. I’ve tried it in a whole bunch of disros that use PCManFM, figuring they would know how to set up things properly, so I could rule out mis-configuring on my part as a cause.

---

<div class="post-metadata">

**Author:** ![LamnaNasus](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/lamnanasus/32/10804_2.png) [@LamnaNasus](https://forum.endeavouros.com/u/LamnaNasus)\
**Post date:** [January 28, 2023, 12:33pm UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/38 "2023-01-28T12:33:19Z")

</div>

OK, my script knowledge is rather poor, haha. If I understand it correctly, the script isn’t for opening anything, but more like setting a rule. But I don’t know how that guy used it, and it is beyond me to use it myself.

---

<div class="post-metadata">

**Author:** ![LamnaNasus](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/lamnanasus/32/10804_2.png) [@LamnaNasus](https://forum.endeavouros.com/u/LamnaNasus)\
**Post date:** [January 28, 2023, 12:49pm UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/39 "2023-01-28T12:49:54Z")

</div>

It is a mystery to me why this hasn’t been mentioned by CNN and BBC, not even during slow parts of the day.

One has to trawl the net for hours and hours, only to find a couple few forgotten forum posts here and there with no solutions. I can’t be the only one to use this combination?

---

<div class="post-metadata">

**Author:** ![ringo](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ringo/32/66182_2.png) [@ringo](https://forum.endeavouros.com/u/ringo)\
**Post date:** [January 28, 2023, 12:52pm UTC](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490/40 "2023-01-28T12:52:39Z")

</div>

wil try to ask in lxqt channel … i believe pcmanfm is bit pauzed…but stil forward mayby someone helps me

[Previous page](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490.md?page=1)

[Next page](https://forum.endeavouros.com/t/pcmanfm-open-and-save-files-with-onlyoffice/36490.md?page=3)
