Setup Display On Rpi
Xorg Display Server
1 | sudo apt-get install --no-install-recommends xserver-xorg |
Desktop Environment and Openbox Window Manager
1 | sudo apt-get install lxde-core |
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 |
|
- Start vnc server by
tightvncserver
or with more optionsvncserver :0 -geometry 1920x1080 -depth 24
tightvncserver == vncserver - Stop vnc server by
tightvncserver -kill :1
3 .Download tvnjviewer-2.8.3-bin-gnugpl and connect to vnc server byjava -jar tightvnc-jviewer.jar
x2x
On RPi
sudo apt-get install x2x
- make sure
X11Forwarding yes
in /etc/ssh/sshd_config
On Workstation 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 | xdotool click 1` 按下滑鼠左鍵(左鍵:1、滾輪:2、右鍵:3、滾輪上/下:4/5) |
Android <=> RPi
Install simplecomputerremote on RPi
1
2
3wget http://philproctor.github.io/SimpleComputerRemote/downloads/simplecomputerremote_1.2_armhf.deb
sudo dpkg -i simplecomputerremote_1.2_armhf.deb
/opt/rekap/SimpleComputerRemoteConfigure simplecomputerremote to run after desktop environment startup
1
2
3mkdir /home/pi/.config/autostart (if the directory does not exist.)
cd /home/pi/.config/autostart
sudo nano SimpleComputerRemote.desktopAdd 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=ApplicationAs 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