I would like to pass the hostname of a Raspberry Pi to Chromium in ~/.config/lxsession/LXDE-pi/autostart

The relevant parts of the command are:

@chromium-browser --incognito --kiosk https://www.example.com?pi=`hostname`

I tried using several different syntaxes to either execute hostname or read the $HOSTNAME environment variable, no luck.

1 Answer 1


Found the answer here: https://wiki.lxde.org/en/LXSession

Notice that lines are split on space characters, but no form of escaping or quoting is supported, nor are multi-line commands. So if you need, e.g., a command with a space in one of its arguments, put it in a shell script and invoke the shell script from the autostart file.

Switched to call a shell script which invoked the browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.