25

I am planning to use my RPi only for one application, which needs X server to be started.

This application is chromium, which requires A LOT of resources already.

I would like to start only the bare minimum (X server) to display chromium in --kiosk mode (fullscreen, can't exit, don't show desktop or anything else)

Is it possible, and if so, how?

cwd
  • 318
  • 1
  • 4
  • 12
DrakaSAN
  • 437
  • 1
  • 4
  • 11

2 Answers2

17

You can apply hildred's suggestion permanently by creating a ~/.xinitrc file:

#!/bin/sh

exec chromium --kiosk

This will then be applied if you are using a graphical login, so that you do not have to boot to console. To test it from the console, try startx with no arguments.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
  • 1
    to be more frugal with your memory use exec on the last line of your .xinitrc so you don't have a extra shell lying around using memory/swap – hildred Nov 23 '13 at 23:29
  • 1
    @hildred - just curious, approximately how much memory does a shell require? – cwd Nov 25 '14 at 04:41
  • 1
    @cwd You can get an idea with ps -o pid,rss,cmd -C bash. The RSS is in kB, it's probably 3-4000, but if you then look at top -p [pid] where pid is one of the ones reported by ps, you'll probably see 75% of that is shared (RSS vs SHR). So an extra shell takes a MB or two of RAM. I've edited hildred's suggestion into the answer. – goldilocks Nov 25 '14 at 15:17
15
startx chromium --kiosk --

startx is a wrapper for xinit which starts an xserver and one client program. It should do exactly what you want.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
hildred
  • 916
  • 1
  • 6
  • 20
  • [1:1:13070520614:ERROR:nss_util.cc(692)] Failed to load NSS libraries. (chromium:3191): Gtk-WARNING **: cannot open display: – DrakaSAN Nov 27 '13 at 14:49