Drücke „Enter”, um zum Inhalt zu springen.

Prepare Raspbian Lite Image (Bullseye) booting to Python/GTK+ Applikation

Marc Wapelhorst

Install Raspbian Lite Image (Bullseye) to your SD-Card

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install xserver-xorg
sudo apt-get install xinit

Install some python/GTK+ packages:

sudo apt install gtk+-3.0-dev python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-paho-mqtt

 

Disable ipv6:

sudo nano /etc/sysctl.conf

Add at the end:

net.ipv6.conf.all.disable_ipv6 = 1

 

Autologin User „pi“ to the console:

sudo raspi-config

System Options –> Boot / Auto Login –> Console Autologin

 

Disable Screen Blanking

sudo raspi-config

Display Options –> Screen Blanking –> Off

 

Start xserver for user „pi“:

sudo nano /etc/rc.local

Add before „exit 0“:

su -s /bin/bash -c startx pi&
setterm -cursor off

 

Create ~/.xinitrc to start your application:

nano ~/.xinitrc
sleep 5 
cd ~/temp_py 
chmod +x temp_py.py 
./temp_py.py