WORK IN PROGRESS, NOT FULLY TESTED YET
- Install bumblebee
- set
KeepUnusedXServer
totrue
in /etc/bumblebee.conf - Acquire a copy of primus libgl.so either from your package manager or by compiling from source
- Copy the primus libgl.so to a folder a empty folder inside the flatpak
- Acquire a copy of the primusrun script either from your package manager or from https://github.com/amonakov/primus/blob/master/primusrun
- Copy the primusrun script to your home directory inside the flatpak