Correctly open files via command line
This issue is unique.
- [X] I have used the search tool 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:
#!/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 tried it on ArchLinux
We do not provide an official package for ArchLinux, so I think this is on this package maintainers
About flatpak and another official ways to install DesktopEditors - we have an issue 50898 to implement such feature, but currently, there is not much traction, so I cannot provide any ETA
Yeah I saw that only deb and rpm are packaged (OnlyOffice on ArchLinux is based on the deb package). That's why I tried with flatpak, and the behavior being the same, I took the liberty to open the issue.
My script is just a workaround, a correct fix would probably involve more work.
In my ZorinOS 16.2 (based on Ubuntu), I can't open file with current path (from root, no problem). Is a .deb installation version. This opens ZorinOS on its homepage.
Version 7.0.0.127 of OO.
Why not modify https://github.com/ONLYOFFICE/desktop-apps:
diff --git a/win-linux/package/linux/common/usr/bin/desktopeditors.m4 b/win-linux/package/linux/common/usr/bin/desktopeditors.m4
index aa2bea2..373cea5 100644
--- a/win-linux/package/linux/common/usr/bin/desktopeditors.m4
+++ b/win-linux/package/linux/common/usr/bin/desktopeditors.m4
@@ -1,5 +1,13 @@
#!/bin/sh
+for argv; do
+ if [ -f "$argv" ]; then
+ argv="$(realpath "$argv")"
+ fi
+ set -- "$@" "$argv"
+ shift
+done
+
ifelse(M4_COMPANY_NAME, ONLYOFFICE,
set_names() {
case $LANG in
This was added in version 8.1.0 https://github.com/ONLYOFFICE/desktop-apps/commit/7f81e2ec45fe739c53bb66a974fc890c02dd5cee
DocumentServer v8.1.0 is released so I close this issue. Feel free to comment or reopen it if you got further questions.