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

WPS doesn't launch in all-in-one mode #65

Open
fenris opened this issue Mar 7, 2020 · 25 comments
Open

WPS doesn't launch in all-in-one mode #65

fenris opened this issue Mar 7, 2020 · 25 comments

Comments

@fenris
Copy link

fenris commented Mar 7, 2020

I've installed the WPS then I tried to change it to make it available to open all-in-one. Then after restarting the WPS ... it doesn't run anymore.

How to revert back to WPS modules instead of all-in-one?

@gasinvein
Copy link
Member

Try removing lines

wpsoffice\Application%20Settings\AppComponentMode=prome_fushion
wpsoffice\Application%20Settings\AppComponentModeInstall=prome_fushion

from ~/.var/app/com.wps.Office/config/Kingsoft/Office.conf file.

@fwolf
Copy link

fwolf commented Mar 19, 2020

By the way, removing this 2 line of config, also solved my wps missing titlebar problem, and newest version won't start problem !

In Ubuntu, it in ~/.config/Kingsoft/Office.conf .

@dwuku
Copy link

dwuku commented May 6, 2020

Is it possible to actually make AIO work?

@gasinvein
Copy link
Member

@dwuku Does it work in non-flatpak package?

@dwuku
Copy link

dwuku commented May 6, 2020

Yes, works fine. I was using 11.1.0.9080 deb package before switching to the flatpak

@gasinvein
Copy link
Member

gasinvein commented May 6, 2020

Looks like WPS Office all-in-one mode doesn't work when XDG_CONFIG_HOME is set, even if it points to the default path ($HOME/.config). Not sure if this can be easily fixed on our side.

@dwuku
Copy link

dwuku commented May 7, 2020

@gasinvein just out of curiosity, how did you figure this out?

@gasinvein
Copy link
Member

gasinvein commented May 7, 2020

@dwuku I've tried to reproduce flatpak environment on host, e.g. set XDG_*_HOME vars, which are usually unset otherwise.

@gasinvein gasinvein changed the title All-in-One WPS WPS doesn't launch in all-in-one mode May 7, 2020
@gasinvein
Copy link
Member

gasinvein commented May 7, 2020

We can workaround this by symlinking ~/.config to $XDG_CONFIG_HOME in the sandbox and then unsetting XDG_CONFIG_HOME upon startup, but this can break things for users who've added filesystem overrides, especially --filesystem=home.

@dwuku
Copy link

dwuku commented May 7, 2020

Symlinking ~/.config did not work for me. But interestingly, if you do not touch anything else and only unset XDG_CONFIG_HOME by entering a shell inside the flatpak, AIO mode does start working. Of course as soon as you exit the shell the config files are deleted (I think the new ones are created in /Kingsoft ?)

@gasinvein
Copy link
Member

@dwuku I've meant symlinking ~/.config and unsetting XDG_CONFIG_HOME both inside flatpak sandbox, surely.

@dwuku
Copy link

dwuku commented May 7, 2020

@gasinvein could you please elaborate a bit on how to create this symlink? I create a filesystem override to ~/.config first?

@gasinvein
Copy link
Member

@dwuku I'll open a PR with modified wrapper once/if I figure out how to do this safely.

I create a filesystem override to ~/.config first?

No! You absolutely shouldn't create filesystem overrides like this.

@dwuku
Copy link

dwuku commented May 7, 2020

@gasinvein alright thanks, but could you still answer the question please? Just for knowledge. What did you mean by symlinking ~/.config to $XDG_CONFIG_HOME ?

@gasinvein
Copy link
Member

gasinvein commented May 7, 2020

@dwuku By default, in the flatpak sandbox /home is on a per-instance tmpfs, so normally ~/.config doesn't exist in the sandbox. Instead, a special directory ~/.var/app/com.wps.Office/config is mounted from host, and XDG_CONFIG_HOME env var points to it.
My idea (not sure if it's a good one, though) was to add to the wps.sh wrapper something like
ln -s $XDG_CONFIG_HOME $HOME/.config followed by unset XDG_CONFIG_HOME,
so that we'll end up with config files still stored in ~/.var/app/com.wps.Office/config, but without XDG_CONFIG_HOME env var set.
Doing so is unsafe, since user may have filesystem overrides, so we'll have to check that ~/.config doesn't exist in sandbox, first.

@dwuku
Copy link

dwuku commented May 7, 2020

@gasinvein ah got it, inside the sandbox! For some reason I was thinking about the ~/.config of the host. Thanks so much for explaining in detail.

This workaround indeed does the job, I gave it a try just now.

The behaviour is a bit confusing though.
Once that symlink is created, the application does work fine, but the wrapper throws a message in the beginning which says "No config exists, creating one" and when you do ls / there is a new /Kingsoft directory (which is otherwise not created when XDG_CONFIG_HOME is not unset)

@gasinvein
Copy link
Member

@dwuku The wrapper needs to be modified to handle this correctly.

@dwuku
Copy link

dwuku commented May 7, 2020

@gasinvein oh right, yes.

Also, I'm wondering if this could be useful in any way. Although, goes against sandboxing principles I guess.

@gasinvein
Copy link
Member

I think it was fixed by latest upstream update, I can't reproduce it since of 11.1.0.10161
Can you please re-test if the issue is still present?

@okkymabruri
Copy link

Hi Guys, I got this issue on my machine, ubuntu 21.04 with WPS 11.1.0.10161
Could you tell me how to solve this issue?
@gasinvein

@gasinvein
Copy link
Member

@okkymabruri I can't reproduce it anymore, but you still can try this.

@okkymabruri
Copy link

@gasinvein , I have tried it on
~/.config/Kingsoft/Office.conf
~/.var/app/com.wps.Office/config/Kingsoft/Office.conf
but still doesn't work

@Sciroccogti
Copy link

Sciroccogti commented Nov 19, 2022

@fwolf

In Ubuntu, it in ~/.config/Kingsoft/Office.conf .

In my Ubuntu 22.10, the file does not exist. Is it placed somewhere else?

@fwolf
Copy link

fwolf commented Nov 20, 2022

I'm using debian sid now, and the conf file is still there, dont know Ubuntu 22.10 change it or not.

@fwolf

In Ubuntu, it in ~/.config/Kingsoft/Office.conf .

In my Ubuntu 22.10, the file does not exist. Is it placed somewhere else?

@Sciroccogti
Copy link

OK I find it in ~/.var/app/com.wps.Office/config/Kingsoft/Office.conf.

In my case, the two lines mentioned by @gasinvein do not exist originally, and manually adding them will enable all-in-one mode. That's great.

I'm using debian sid now, and the conf file is still there, dont know Ubuntu 22.10 change it or not.

@fwolf

In Ubuntu, it in ~/.config/Kingsoft/Office.conf .

In my Ubuntu 22.10, the file does not exist. Is it placed somewhere else?

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

No branches or pull requests

6 participants