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

Raspberry Pi OS • Re: Autostart with labwc

$
0
0
I appreciated the information in this thread!

Sharing because I wanted to auto start chromium in kiosk mode and point it to my OctoPi url after a rebuild and this page helped.

Long story:
Fired up my Raspberry Pi 3B R1.2 after it being offline for ~5 years which still functioned but...
Couldn't update OctoPi due to a Python 2.7 -> 3 issue.
After a day of mucking around found out that it was easier to just build a new one...

Hopped onto another computer and installed RaspberryPi Imager.
Downloaded a new Debian Bookworm OctoPrint version 1.11.1 with OctoPi 1.1.0 and sent it to the SD card.
Slapped the SD card into the Pi and let it do all it's boot things.
Did the normal sudo apt update and sudo apt upgrade -y.
Installed chromium via sudo apt install chromium
Uninstalled old things with sudo apt autoremove
Used the sudo /opt/octopi/scripts/install-desktop command to install the Default OctoPi recommended GUI from the command prompt.
Used the sudo raspi-config to set it to auto log into the GUI.
Immediately after reboot was greeted in the GUI with a warning to upgrade to LABWC, which I did.

After a two days of searching and trying all sorts of hacky ways which didn't work found this page. All the other pages and posts recommended just going back to X... setting up endless chron loops, setting a chromium kiosk service and were very unhelpful.

Ultimately the the solution was way too simple... create a few directories and files in the right places and set execute permissions listed below...

Short story steps:
SSH to my pi

Type the following commands:
  • cd ./config
    mkdir labwc
    cd labwc
    touch autostart
    nano autostart
Enter one line into the file:

Code:

/usr/local/bin/kiosk.sh
Save and exit the file:
CTRL-O
CTRL-X

Create a kiosk.sh file in /usr/local/bin with the following commands:
  • cd /usr/local/bin
    sudo nano kiosk.sh
Enter 3 lines:

Code:

#!/bin/bashsleep 4/bin/chromium-browser  --kiosk  --ozone-platform=wayland --start-maximized http://127.0.0.1:5000 &
Save and exit the file:
CTRL-O
CTRL-X

Make the file executable:
  • sudo chmod +x kiosk.sh
Reboot the Pi

Statistics: Posted by Ouija — Sun Jun 01, 2025 10:09 pm



Viewing all articles
Browse latest Browse all 3546

Trending Articles