This is only tested on the Makerbot Replicator 2 running the latest Sailfish v7.8 firmware. Install the firmware according to the instructions on Sailfish. To automatically generate .x3g-files, a postprocessing script is run from the print configuration. This requires GPX to be installed on the system and located at /usr/bin/gpx.
On ubuntu just run:
sudo apt install gpx
finally:
checkout this repo to ~/.config/PrusaSlicer/