I would like to run a web browser or a simple GUI without running the whole desktop. I want to use my Raspberry Pi as a simple web server, but still have a very simple GUI for controlling my 3-D printer with a few buttons and graphs. I don't want to run the whole desktop, because this will slow down the Pi. How might I accomplish this?
2 Answers
The basic issue is to circumvent any window manager, etc., that runs by default after you start X. If you use a display manager (this provides a graphical login screen) you should be able to do keep using it.
In any case, create a file in your home directory called .Xclients
(with the leading dot) that looks like this:
#!/bin/sh
lxterminal
I'm using lxterminal
as an example, and because it ships with raspbian. Now make this file executable:
chmod 750 .Xclients
Then, without X running:1
startx
You should end up with just a plain terminal on the screen, no titlebar, no borders, and the X mouse cursor. You can start other applications and move around with the cursor but there are no menus, etc.
If you substitute the name of the lone application you want to run for lxterminal
, you'll start with that instead.
1. You can kill X from the inside with ctrl-alt-backspace
, but if you are using a display manager, you'll go back to the GUI login. That's okay.
-
Surprisingly that didn't work for me :( something somewhere I did wrong and it simply starts regular window manager Commented Jul 2, 2015 at 21:25
-
@PiotrKamoda I don't stay abreast of all the possibilities here -- and your comment leave a lot of ambiguities -- but I will recommend researching this as a general linux question.– goldilocks ♦Commented Jul 3, 2015 at 1:12
-
@goldilocks I tired with no success, nobody does explain the issue as thoroughly as you did. I tried it with fresh raspbian, only PiTFT and wxPython installed. It seems as it would ignore .xclients (or .Xclients, all other files are lowercase?) Would it work with .xinitrc file? I also tried to put .xclients in /etc/X11/xinit where other .xsomething files are located. Commented Jul 3, 2015 at 7:20
-
wiki.archlinux.org/index.php/… is a solution using .xinitrc, it might work for those that .xclients didn't help Commented Jul 3, 2015 at 10:00
-
@PiotrKamoda Actually I use
~/.xinitrc
on Raspbian, and it should work anywhere since this is an X feature -- but note I don't use a graphical login. That may mess with stuff. If you do, the default DM (= display manager, which does the login) on Raspbian islightdm
, so that's what you want to research configuring.– goldilocks ♦Commented Jul 3, 2015 at 14:45
One possible option is to use X-forwarding from another computer. This will load the GUI application and run it as it would on the RaspPi but the "display" will be on the remote computer.
For example from another Linux desktop that is running X you would enter the following in the terminal "ssh -X [email protected]" (where xx's are the IP address). Once you are logged in you can run the GUI application from the RaspPi command line such as the web-browser "midori". In this case Midori would run as if it was on the RaspPi but the GUI would show up on the remote computer, sort of like a mini remote desktop that only shows one window.
This can also be setup on a Windows computer using Putty. Google putty x-forwarding and you will find many options to configure this.