I'm trying to use openbox to customize my raspberry pi 3. Basically, what I want to do is start an openbox session on boot up and have openbox autostart a GUI application. This is what I have so far
in ~/.config/lxsession/LXDE-pi/autostart
I commented out the first 3 lines:
#@lxpanel --profile LXDE-pi
#@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
and added this line:
@openbox-session
This causes openbox to start when I boot up my system. I see a black screen
Following this guide: http://openbox.org/wiki/Help:Autostart It says that
"When you log in with the "Openbox" session type, or launch Openbox with the openbox-session command, the environment script will be executed to set up your environment, and the autostart script can launch any applications you want to run at startup."
so, I edited the autostart file in ~/.config/openbox/autostart in my pi user. (I also tried editing the global file) I put this in the file:
/home/pi/mystartupprogram
On first reboot it worked my GUI starts up which is great but...next reboot I'm back to black screen and I see part of my GUI in the top left corner and all the rest is black.
-
2Hi did you ever solve this? I'm researching the most light-weight possible way to create a kiosk that will show a web page with possible image transitions (dakboard.com specifically). I would like to use a Pi Zero W so it's gotta be REALLY light. I wish someone had an opengl or framebuffer driven browser that could run from the GPU from the terminal (graphical - not lynx)Adam Plocher– Adam Plocher2017年05月19日 06:57:54 +00:00Commented May 19, 2017 at 6:57
3 Answers 3
This is the simple answer: sudo update-alternatives --config x-session-manager
One can just run this and select the openbox-session then the next restart will get you the openbox window manager.
No need for hacking files etc.
-
Can you edit and expand upon your answer, else it may be deleted. Stack Exchange is looking for comprehensive answers.2021年01月14日 17:34:30 +00:00Commented Jan 14, 2021 at 17:34
-
This answer doesn't need any more explaination this is the best way to switch to an alternative window manager on a raspberry piCoderChris– CoderChris2021年01月20日 12:40:57 +00:00Commented Jan 20, 2021 at 12:40
-
This is the right answer: if the OP will ever want to go back to lxsession, or have to reconfigure a system after reinstalling it, doing manual changes in a bunch of config files will take lots of time.Dmitry Grigoryev– Dmitry Grigoryev2021年01月25日 08:38:57 +00:00Commented Jan 25, 2021 at 8:38
-
Instead of rebooting, restarting the display manager should be sufficient.
sudo systemctl restart display-manager.service
sshow– sshow2021年10月05日 08:38:33 +00:00Commented Oct 5, 2021 at 8:38 -
what reasons might there be for this change to not take effect? Running this command, selecting openbox-session and rebooting still booted me into the full lxde desktop, rather than openboxPatronics– Patronics2024年10月01日 07:39:38 +00:00Commented Oct 1, 2024 at 7:39
I had the same problem. I post it for any future googlers.
Disable Desktop autologin
Runsudo raspi-config
and navigate to3 Boot Options
/B1 Desktop / Cli
and chooseB2 Console Autologin
Run
Openstartx
inrc.local
rc.local
withsudo nano /etc/rc.local
. At the end, beforeexit 0
addstartx &
Configure
xinitrc
sudo nano /etc/X11/xinit/xinitrc
Comment this line
. /etc/X11/xsession
Add this line to start openbox
exec openbox-session
Run your programs with
autostart
sudo nano /etc/xdg/openbox/autostart
Add your commands
/path/to/program &
Important: End all commands with
&
Voilà, you have now an Raspberry Pi that automatically boots to Openbox and autostarts your applications
-
Worked perfect, but I've used the following part in
~/.bash_profile
:[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx
(instead of therc.local
part)Michael B.– Michael B.2022年05月23日 08:35:52 +00:00Commented May 23, 2022 at 8:35
I found this to be useful
install the rpi lite version then:
sudo apt install lightdm openbox
lightdm = login manager, just use raspi-config to select autologin gui
openbox = gui to run your app
you can use a tty for command line to setup your app to auto start:
example:
mkdir ~/.config/autostart
nano ~/.config/autostart/my_app.desktop
in nano:
[Desktop Entry]
Type=Application
Exec=/path/to/my/app <-best to use full path ex: /home/pi/bin/my_app