Blog
Monday, 05 May 2014 11:59

Raspberry Pi: Running Midori browser without a Desktop

Midori is a lightweight browser using the WebKit rendering engine and it is a default browser that is found in Raspbian. This is a quick quide to start the Midori browser from the command line without a desktop manager.

 
To start the Midori in full screen mode, use the following command:
xinit /usr/bin/midori -e Fullscreen -a http://domain/homepage.html
 
However it is not in full screen mode, it just fill up about quarter size of the screen. To fix this problem, Midori must run on a windows manager. Here is the solution:
 
Install the matchbox software which is is a free and open source window manager for the X Window System. Matchbox is mainly intended for embedded systems and it is very lightweight.
sudo apt-get install matchbox
 
Create a file in your home directory (/home/pi) called startMidori
Now run xinit ./startMidori (with the leading dot) and the Midori window should be fullscreen.
 
Note: You might need to install x11-xserver-utils in order to make the xset -dpms and xset s off to work correctly. 
sudo apt-get install x11-xserver-utils
 
 

Hiding the mouse pointer

Install unclutter. It will hide your mouse pointer if there is no activity.
sudo apt-get install unclutter
Execute unclutter before Matchbox Window Manager, your script should look like this:
 
 

Force the Raspberry Pi to use HDMI mode and changing Resolution

Please read here on how to force the Raspberry Pi to use HDMI mode and output the right resolution 
 
 

Autorunning programs on startup 

Edit the /etc/rc.local file. Apeend one line just before exit0 as shown in figure below
  • The sudo command stands for "superuser do", it assumes you want your application run with root user privileges.
  • The "&" cause the application running in background.

 

Press CTRL + ALT + F1 exit back to command prompt after the program (Midori) is running.
Press CTRL + ALT + F7 return to Matchbox Window Manager 
 
Read 48067 times Last modified on Tuesday, 01 March 2016 23:07

5 comments

  • Comment Link admin Tuesday, 02 August 2016 11:29 posted by admin

    Using crontab shoud solve your problem
    https://www.raspberrypi.org/documentation/linux/usage/cron.md

    To run a command every time the Raspberry Pi starts up, write @reboot instead of the time and date.

  • Comment Link Dan Monday, 01 August 2016 22:42 posted by Dan

    excellent tutorial and gets me 90% of the way to what I need, just one thing.
    Is there a way to wait until the entire other services have finished loading before loading this?

    I am using this for a kiosk style thing for the office, where other services on the Pi need to load before opening the browser, without doing this it always loads into a blank page as the http service has not started yet

  • Comment Link admin Thursday, 07 April 2016 16:11 posted by admin

    You neeed to install Matchbox Window Manager.
    https://www.yoctoproject.org/tools-resources/projects/matchbox

    You can run Midori browser without Matchbox Windows Manager, however it cannot run in full screen mode.

  • Comment Link surendar Thursday, 07 April 2016 13:43 posted by surendar

    does we need NODM or any display manager to run

  • Comment Link Moorthy Tuesday, 01 March 2016 21:43 posted by Moorthy

    Thank you very much. This has been very helpful.

Leave a comment