Monday, 8 February 2021

WPS Office Qt based on GTK

 

Use GTK+ UI

The default UI of WPS is Qt. In fact, the bundled Qt is 4.7.4, so the themes such as qtcurve cannot be loaded normally because the versions do not match. But we can change it to GTK+ and add the parameter -style gtk+ directly.

You can modify the et, wpp, and wps files in the /usr/bin/ directory and delete it (if any):

gOpt=

Then, add:

gOpt="-style=gtk+"
export GTK2_RC_FILES=/usr/share/themes/Breeze/gtk-2.0/gtkrc

Manually repair Kingsoft PDF startup script

The startup script provided by Kingsoft PDF is missing the custom configuration of GTK. You can add it at the beginning of its startup script /usr/bin/wpspdf:

gOpt="-style=gtk+"
export GTK2_RC_FILES=/usr/share/themes/Breeze/gtk-2.0/gtkrc

And add ${gOpt} to the subsequent run function, the modified run function is as follows:

function run()
{
	if [ -e "${gInstallPath}/office6/${gApp}" ] ; then
		{ ${gInstallPath}/office6/${gApp} ${gOpt} "$@"; } >/dev/null 2>&1
	else
		echo "${gApp} does not exist!"
	fi
}
Note: Since each upgrade may result in the loss of file modifications, you may consider copying the et, wpp, and wps files to other directories (for example: ~/.local/bin/) and adding them to Environment variables.
Share:

0 comments:

Post a Comment