0

I am trying to start django with a Desktop Entry file and open a chromium browser in kiosk mode to show a locally served website which shows some weather reports for my area etc ... I put some sleep seconds before starting up the browser because I want to wait for django to start up etc ...

Working:

[Desktop Entry]
Type=Application
Name=ChromeBrowser for weatherdata
Exec=/bin/bash -c "sleep 20 && chromium-browser --kiosk "127.0.0.1:8001" --start-fullscreen"

not working (starting django):

[Desktop Entry]
Type=Application
Name=Django Server
Exec=/bin/bash -c "python3 /home/me/app manage.py runserver 8001"
Terminal=true

I just never see an open terminal or can find a running python instance with htop. What am I missing? I also find no errors of the desktop entry process when running journalctl. I tried to create my file using this answer. Reading the specification did not bring enlightment.

So I have two questions:

  1. what am I missing here?
  2. where would I find a log of whats happening?
  3. (is the only way to make this work to write an sh script that executes my django command?)
xtlc
  • 103
  • 1
    could be the "space" in app manage.py. Besides this, it makes more sense to configure and start such background processes with systemd. – Marco May 25 '23 at 07:54
  • that was exactly the issue! /home/me/app manage.py -> /home/me/app/manage.py and now it works. Please post as answer, I will accept it. Also: Do you know anything about the logs? And why is systemd the better approach to the problem? – xtlc May 25 '23 at 07:59

1 Answers1

1

The space in the app path is the problem or the wrong quotes.

Means, ether remove the space or use correct quotes.

Exec=/bin/bash -c 'python3 "/home/me/app manage.py" runserver 8001'

You can test the .desktop files from commandline with gtk-launch which will show the errors, if any.

gtk-launch "/path/to/mycommand.desktop"

Using systemd user is usually the more generic way, especially if the program is independent of a graphical environment (e.g. start on ssh login), see man systemd.unit. But of course it is a bit more complex. You will find many manuals for this with help of Google.

Marco
  • 1,188