Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8082

Beginners • autostart a python script in a GUI terminal

$
0
0
I have a problem auto-starting a python script in a terminal in a GUI environment.The computer is a RP5
pi@pi:~ $ hostnamectl
Static hostname: pi
Icon name: computer
Machine ID: 55f4e7a7065a45db8d3d96ff584e6f80
Boot ID: 1270837cdbdf497c8003ee01e945595d
Operating System: Debian GNU/Linux 12 (bookworm)
Kernel: Linux 6.12.34+rpt-rpi-2712
Architecture: arm64
I have read the the beginners guide for running a program at start-up , but was not succesfull.

First I started with section 5 , Full desktop with X11.
This configuration yields a gray screen when used in headless mode.

Section 6 Wayland/wayfire
Autostart via wayfire.ini

I added the following to the wayfire.ini file :
[autostart]
terminal=lxterminal
command=python3 /home/pi/myscript.py

This just yields a terminal window , but does run the python script. Also the beginner guide does not clarify what
can be used as unique id = some command to run a script

Autostart via a .desktop file
I created a new file in /home/pi/.config/autostart named myscript.desktop

Desktop Entry]
Type=Application
Exec=lxterminal
Exec=python3 /home/pi/Desktop/myscript.py

If I omit the last line the terminal window is started, otherwise no terminal appears.

Section 7 Wayland/labwc
Autostart via wayfire.ini
Same behavior as Section 6 Wayland/wayfire

Section 7.1.1.3
Usage
1. Open $HOME/.config/labwc/autostart should be $HOME/pi/.config/labwc/autostart

Autostart via a .desktop file

Same behavior as Section 6 Wayland/wayfire

With the previous OS you could have an autostart file with e.g. @lxterminal python3/home/pi/myscript.py , so how do I get that same functionality with bookworm ?

Statistics: Posted by ZoomPi — Mon Sep 01, 2025 11:17 pm



Viewing all articles
Browse latest Browse all 8082

Trending Articles