0

I'm coding on Linux Mint 20, with Python 3 and Tkinter. The project is a simple launcher/startpage (I really don't know how to call it) for the Linux desktop. After completed and installed it should launch on startup and show, full screen, buttons with all the things I need to use on a daily basis (applications, folders, web pages, etc.).

Until now I have only three buttons linked, one for quitting the program, one to open the file manager and one for the web browser. The first two work alright.

The latter launches the browser but it has a weird behaviour: If I already have another instance of the browser opened, it works fine. But if I don't, the button stays clicked, the rest of them don't work and the terminal shows this error:

libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
[5142:5142:0506/230558.723832:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[5113:5113:0506/230559.459826:ERROR:CONSOLE(1)] "[Shields]: Can't request shields panel data. Error: No tab url specified", source: chrome-extension://mnojpmjdmbbfmejpflffifhffcmidifd/out/brave_extension_background.bundle.js (1)
[5113:5113:0506/230600.942788:ERROR:sharing_service.cc(218)] Device registration failed with fatal error

When I close the browser, my little program shuts down.

The command used to open the browser is:

os.system('/usr/bin/brave-browser-stable')
  • You need to add a URL as a parameter, `/usr/bin/brave-browser-stable "http://google.com"` – Philip Rollins May 07 '21 at 02:32
  • The code is now: `os.system('/usr/bin/brave-browser-stable "https://wikipedia.org/"')` It opens the browser on wiki but the odd behaviour and the error message are still there. – fred koretsky May 07 '21 at 03:04
  • And added the following error: `[10193:10214:0506/235927.933522:ERROR:get_updates_processor.cc(257)] PostClientToServerMessage() failed during GetUpdates with error 2` – fred koretsky May 07 '21 at 03:09
  • The docs suggest to use "subprocess" instead of "system". What's happening there is that your program waits for your browser to finish (sysem() is geared towards non-interactive command line tools). Have a look at the answers and discussions [here](https://stackoverflow.com/questions/1196074/how-to-start-a-background-process-in-python). – tink May 07 '21 at 05:37
  • 1
    what if You just use `os.startfile("www.wikipedia.org")`? – Matiiss May 07 '21 at 06:43
  • 1
    Update: as @tink sugested, I changed my code from: `os.system('/usr/bin/brave-browser-stable')` to: `subprocess.Popen('brave-browser')` and it works fine now. – fred koretsky May 08 '21 at 23:51

0 Answers0