WPS not starting on KDE and Kmenuedit not saving changes

After the recent update of WPS for linux, it stopped working on desktops with KDE variants. So I looked around and found the solution listed below. In the meantime, this article also provides a workaround for kmenuedit's bug of not saving changes correctly.

WPS not working on KDE

You may have encountered the problem of calling WPS applications (Writer, Spreadsheet, Presentation) on KDE with nothing happening after a long wait. If you fire up the command in a terminal, you may probably see the following error message.

$ wps 
/usr/bin/wps: line 38: 14887 Segmentation fault      (core dumped) ${gInstallPath}/office6/${gApp} ${gOptExt} ${gOpt} "$@"

The cause is that wps needs to work in an gtk themed environment, and the default KDE Qt environment is not well supported (at the moment).

The solution is pretty easy: add the -style gtk parameters to your command, i.e., you'll use the following commands.

  • For Writer:
    $ wps -style gtk
  • For Presentation:
    $ wpp -style gtk
  • For Spreadsheet:
    $ et -style gtk
Update system-wise application entry with kmenuedit

Surely you don't want to fire up a terminal each time you edit a doc. In KDE, we can edit the system-wise application entry, so that whether you call WPS from krunner or the application menu, it will use the right parameters automatically.

To edit such an entry, you can right click on the KDE icon on the left of your task bar, and choose Edit Applications (by this you start kmenuedit). Then you can find the entries for the WPS applications under the Office category, and edit the command column, adding in the -style gtk parameters. Click save, wait for the progress bar, done.

Or are you?

If you call WPS Writer from krunner or the application menu now, chances are you still got nothing appearing. If you open kmenuedit again, and will surprisingly find that the entries are still listing the old command.

The cause is a bug (or design flaw?) in kmenuedit. Unlike traditional applications, kmenuedit looks at the system-wise desktop files in /usr/share/applications after your personalized desktop files in .local/share/applications, which means even if you successfully saved your edit to the application entries (in .local/share/applications), it will get overridden at runtime by those in /usr/share/applications (which are not modified at all).

Understanding that, the solution is simple (but also tedious), you need to edit the desktop files in /usr/share/applications, by modifying the Exec line, so that you have something like below for WPS Writer, follow similar steps for other applications.

Exec=/usr/bin/wps %f -style gtk