Setup Display On Rpi

Xorg Display Server

1
2
sudo apt-get install --no-install-recommends xserver-xorg
sudo apt-get install --no-install-recommends xinit (for command *startx* to start the Xorg Display Server)

Desktop Environment and Openbox Window Manager

1
2
sudo apt-get install lxde-core
sudo apt-get install lxappearance (Optional, for changing the look of applications such as panels, icons, progress bars, cursors, and so on, give yourself more customization abilities)

Login Manager

sudo apt-get install lightdm
if no login manager was installed, then just login via the command line! At anytime, you can launch the Xorg Display Server by typing in:
startx

Ubuntu <=> RPi

tightvncserver

Install tightvncserver sudo apt-get install tightvncserver (For RPi to install tightvncserver, it needs to install xfonts-base)
Fix gray screen when login to ubuntu 14.04. Update file /.vnc/xstartup as below

1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
def
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
  1. Start vnc server by tightvncserver or with more options vncserver :0 -geometry 1920x1080 -depth 24
    tightvncserver == vncserver
  2. Stop vnc server by tightvncserver -kill :1
    3 .Download tvnjviewer-2.8.3-bin-gnugpl and connect to vnc server by java -jar tightvnc-jviewer.jar

x2x

On RPi

  1. sudo apt-get install x2x
  2. make sure X11Forwarding yes in /etc/ssh/sshd_config
    On Workstation
  3. ssh -X pi@192.168.42.100 x2x -west -to :0 (-west, -north, -south) (-to :X <= echo $DISPLAY on RPi)

Another option xdotool

DISPLAY=:0 xdotool getactivewindow key Down
DISPLAY=:0 xdotool getactivewindow type 'your text here'

1
2
3
xdotool click 1` 按下滑鼠左鍵(左鍵:1、滾輪:2、右鍵:3、滾輪上/下:4/5
xdotool mousedown
xdotool mouseup

Android <=> RPi

  1. Install simplecomputerremote on RPi

    1
    2
    3
    # wget http://philproctor.github.io/SimpleComputerRemote/downloads/simplecomputerremote_1.2_armhf.deb
    # sudo dpkg -i simplecomputerremote_1.2_armhf.deb
    # /opt/rekap/SimpleComputerRemote
  2. Configure simplecomputerremote to run after desktop environment startup

    1
    2
    3
    mkdir /home/pi/.config/autostart (if the directory does not exist.)
    cd /home/pi/.config/autostart
    sudo nano SimpleComputerRemote.desktop

    Add following line in SimpleComputerRemote.desktop file

    1
    2
    3
    4
    5
    6
    7
    [Desktop Entry]
    name=SimpleComputerRemote
    GenericName=Remote Control
    Comment=Allow remote control using Simple Computer Remote
    Exec=/opt/rekap/SimpleComputerRemote
    Terminal=False
    Type=Application
  3. As the app no longer exists in Google Play, you should need to download the apk from other market and install com.rekap.remote.apk on Android. Open the app, go to “Settings > Select Server” and you will see RPi on the list.

Reference

Display
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=133691

x2x
http://raspberrypi.stackexchange.com/questions/4253/forward-mouse-and-keyboard-input-to-x-session
http://linuxcommando.blogspot.hk/2014/07/share-keyboard-and-mouse-on-two-x.html
https://help.ubuntu.com/community/X2xHowto
https://github.com/dottedmag/x2x

Simple Computer Remote
https://www.raspberrypi.org/forums/viewtopic.php?f=27&t=40797
http://sanjosetech.blogspot.hk/2013/10/raspberry-pi-remote-control.html
http://randomcompstuff.blogspot.hk/2014/07/how-to-install-simple-computer-remote.html
Fix grey screen on connecting VNC server when setting up Ubuntu 14.04 with VNC
quadcopter control by RPi