Close LibreOffice Flatpak by obtaining the grandchild process ID
By obtaining the PID of the grandchild process it is no longer necessary to use bash with kill, grep and ps to close the libreoffice process. This way it is also certain that the process that will be closed is the right one.