Open Flatpak program from macro script in Libreoffice Impress

I am using macro scripts in Libreoffice Impress to launch games on my PC. I have set up some pages which have a game showing as an image, when clicked the interaction runs a macro.

My PC uses Kubuntu (one of the many flavours of Ubuntu), ie Linux.

I can link to most games from a script like this:

Sub Main
shell ("/home/john/Emulation/Eden.AppImage -f /home/john/Emulation/ROMS/Switch/AdvanceWars1plus2.nsp")
End Sub

…however I can’t get a Shell command to do the same with a Flatpak app, ie Dolphin, which emulates Gamecube/Wii games.

This doesn’t work:

Sub Main
shell (“flatpak run org.DolphinEmu.dolphin-emu -f /home/john/Emulation/ROMS/Wii/UNO.wad”)
End Sub

It doesn’t seem happy to run a Flatpak app from withing Libreoffice Impress, so I need a workaround.

I have tried all I can think of, spent many hours on trying to get this to work.

I would be grateful if someone could please show me how to do this - what script would work.

I think you are allowed to run the appimage, becaus it is below your home-folder. But a snap is usually resricted to run other commands and may not even “see” the necessary folders.
.
A workaround to not having proper rights may be considered as a bug in rights/security-management…
.
Without violating rights I would only write the command in a text-file doforimpress.do and read/execute this with an external shell-loop.

Please elaborate with how I would do that please, and steps to get that working - thanks.

for me ( debian 13 Trixie ) from normal libreoffice i can run an flatpak-libreoffice via python…subprocess:

from subprocess import Popen
def run_some_flatpak(*_):
    Popen( ["x-terminal-emulator", "-e",
            "/usr/bin/flatpak",
            "run",
            "--command=libreoffice",
            "--file-forwarding",
            "org.libreoffice.LibreOffice",
            "--calc" ] )

you need help to organize your python-stuff in Libreoffice ? ⇒
install apso.oxt from here

edit ps: the following basic-shell works also:

Sub Main
shell("/usr/bin/x-terminal-emulator -e /usr/bin/flatpak run --command=libreoffice --file-forwarding org.libreoffice.LibreOffice --calc" )
End Sub

Thanks for the reply however it doesn’t work.

At best I am getting errors “QT: session management error: could not open network socket” and “SH: line 1: XDG-MIME: command not found”

Just getting blank screen for a moment before closing again, or nothing at all. Tried loads of variations, tried to strip the code back until could get something working to then experiment with but no joy.

Help appreciated please!

Emulator app is : org.DolphinEmu.dolphin-emu
and then a path to the ROM file, eg: /home/john/Emulation/ROMS/Wii/UNO.wad

Sorry … cannot help on the details … maybe replace x-terminal-emulator by konsole ??

and NO! I will not going to install some random stuff from flathub only to find a proper commandline for YOUR specific needs!

1 Like

So you have a regular install via apt?
Because I guess @bacman will have a snap in his

offtopic: yes, plus 2 Downloads from LO ( 25.8 … 26.2 ), plus one via flatpak, plus 2 or 3 different builds from source :face_holding_back_tears:

A “solution” ticked surely is when there is a solution posted, not just “that’s it, tick it”.

I didn’t expect you to install the program for a solution Karolus, I hoped a solution would be made from experience from someone who knows the answer. I’m not a kid or keyboard warrior so no need to post an aggressive reply, thanks. Just hoping for a friendly helpful reply please with a solution that works… :wink:

I have been using computers, including programming them since 1983; I am self-taught Windows and only in the last 2 weeks been using Kubuntu and made great strives, getting pretty much everything I used to use on Windows looking the same on Kubuntu and I have now migrated to it. I am not a noob.

So hopefully, this time of asking, someone will please help me out as this Flatpak issue in Libreoffice has me banging my head against a wall.

Thanks in anticipation…

huh … nobody ticks some Post or comment as solution so … what are you talking about?

tell me, which reply was aggressive? looks like sombody is a bit »oversensitive«

so solve your »problems« by your experience.

If I could solve this problem I wouldn’t have asked for help. I have worked out a lot so far but not this problem. I have spent hours and every Google search I could make to try and resolve this issue. If you know a working solution please help and not troll.

“and NO! I will not going to install some random stuff from flathub only to find a proper commandline for YOUR specific needs!” is aggressive.

People come to forums initially to get answers to specific problems and then stay to help others help them. If they get trolled then they leave. Your choice buddy; potentially have a good member or lose him…