Cyborgscode / Personal-Voice-Assistent

Building a fully featured and localized voice assistant for Linux
141 stars 6 forks source link

Launched programs don't show up #16

Closed Moini closed 1 year ago

Moini commented 1 year ago

Hi,

when I ask Carola (or Mortimer, rather) to start another program for me, the program is not launched in any visible way.

E.g. I say

Mortimer, öffne Inkscape.

and it replies that it opens the program inkscape.

ps -A tells me that inkscape is running.

168319 pts/0 00:00:00 inkscape

The pts/0 is different from how other programs show up in the list - for other GUI programs, I get a '?' instead.

But Inkscape is not visible on my monitor.

Same goes for screenshots - no GUI appears for my flameshot.

Searching something on the web works, though - weather report and time announcing, too. Haven't tested the files part, as I'm not sure how that would work with my folder structure etc.

Sometimes, when I kill pva, the app then shows up on my monitor after Mortimer is 'dead'.

How can I debug this? What could be the cause? (thread, screen, ...)


Note that I have put Mortimer in a custom directory, and did not add it into /usr/, /etc/ etc. Instead, I've adjusted all those little paths everywhere before compiling. It runs without problems now, even though it wouldn't stop reading a file to me instead of a greeting until I hardcoded the greeting path.

Would be cool if the paths weren't hardcoded but in a variable, e.g. in the compile script... would be so much easier (and less error-prone) to adjust.

I'm running it on Linux Mint, based on the older LTS 20.04.

Moini commented 1 year ago

Btw. a .gitignore would be great. It tries tracking all those compiled Java files.

Moini commented 1 year ago

... some of them already ended up in the repository, e.g. https://github.com/Cyborgscode/Personal-Voice-Assistent/tree/main/hash

Cyborgscode commented 1 year ago

PVA just starts the app, if it doesn't wanne open a window, it's up to the app. I don't think I can help you here.

Those Classfiles are there, because I uploaded them to make it easier for people without a JAVAC to start up the app. As we did change a lot, i think i will remove them, so thanks for the hint.

Moini commented 1 year ago

Can you point me to the place in the code where the other programs are started, please?

Cyborgscode commented 1 year ago

PVA.java -> Exec()

Cyborgscode commented 1 year ago

regarding your app startup issue.. A thought: if pva isn't started in the desktop environment, your won't get windows.

Moini commented 1 year ago

Thanks, yes, I was going to try out whether using https://docs.oracle.com/javase/1.5.0/docs/api/java/lang/ProcessBuilder.html and logging the environment that's passed in gives me a different result / a hint.

Not a Java dev, though (or any kind of dev, really).

Cyborgscode commented 1 year ago

don't be so complicated:

#!/bin/bash

strings /proc/self/environ >> /tmp/debug.log
APPNAME
Cyborgscode commented 1 year ago

If exec() would have such problems, QMMP or others would never start up. I just tested inkscape on my installation. It started perfectly and i did not even configure it. PVA found it in the apps directory and just started it up.

Cyborgscode commented 1 year ago

Did you solve it?

Moini commented 1 year ago

I haven't retried yet, sorry. Planning to do so next year ;-)

Cyborgscode commented 1 year ago

Any News?

Moini commented 1 year ago

Nothing new as of yet. I'm dreading the work it will take to keep it saved in a non system directory when I update it from the repository. /usr/bin ... and /etc/ ... are hardcoded everywhere.

Moini commented 1 year ago

I've tried it again with the non-updated version.

Findings:

Don't know what else to try. Seems pva is in some way blocking Inkscape. It's also not because of the pythonenv I have it running in, tried that in terminal... Other programs do not seem affected. I was not able to start Krita, it always understood 'Kreta'. Seems to ignore the contextreplacement thing there.

Not sure it's worth pursuing this. Thank you for all the suggestions, though!

Cyborgscode commented 1 year ago

honestly, sounds like an inkscape issue to me.