Score:0

Autostart with Desktop Entry only works for GUI applications

ve flag

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?)
Marco avatar
br flag
could be the "space" in `app manage.py`. Besides this, it makes more sense to configure and start such background processes with systemd.
xtlc avatar
ve flag
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?
Score:1
br flag

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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.