Search code examples
linuxcommand-lineraspberry-piraspbian

Raspberry Pi config - read parameters from a seperate file


I have a raspberry pi configured to boot chromium full screen which works great. However, I want my non-techy user to update the website by simply editing a file on the desktop.

/etc/xdg/lxsession/LXDE-pi/autostart:

    # Link to the settings file on the desktop
    source /home/pi/Desktop/websetup.config

    # start chromium
    @chromium --noerrdialogs --kiosk $website --incognito

I would like to have a setup file on the desktop which my user can update the website and overscanning etc without directly editing any config files above:

i.e.

websetup.config:

# Enter website to show
webbsite=https://newWebsite.com

# Overscanning on = 1, turn off = 0
overscan=0

I, however, can output $website from a .sh bash but I cannot work out how to pass the value $website to chromium as I cannot pass the actual value


Solution

  • ok, I have managed to work it out. I created a script called run_chromium.sh:

    ##
    ## this file is referenced in: /etc/xdg/lxsession/LXDE-pi/autostart
    ##
    
    ## website to show
    website=https://www.website.com
    
    ## 0=overscanning off, 1=on
    overscanning=1
    

    and I linked to this script in autostart:

    /bin/bash /home/pi/Desktop/run_chromium.sh