Difference between revisions of "Ubuntu 18 04 modifications"

From RobotinoWiki
(Mirror display)
Line 6: Line 6:
 
</pre>
 
</pre>
  
==Mirror display==
+
==Activate only one display==
Use arandr to create screenlayout script and add it to Startup Applications Alt+F2 and run the gnome-session-properties
+
Script to check which display is connected. If VGA is connected make it the primary display and disable the others. If HDMI-1 is connected make it the primary display and disable the others. If non is connected use the internal display.
 +
 
 +
Add it to Startup Applications Alt+F2 and run the gnome-session-properties
 +
 
 +
<pre>
 +
#!/bin/bash
 +
 
 +
for (( ; ; ))
 +
do
 +
 
 +
xrandrout=$(xrandr)
 +
 
 +
if [[ $xrandrout == *"DP-3 connected"* ]] ; then
 +
  echo DP3
 +
  xrandr --output DP-3 --primary --auto --output eDP-1 --off --output HDMI-1 --off
 +
elif [[ $xrandrout == *"HDMI-1 connected"* ]] ; then
 +
  echo HDMI-1
 +
  xrandr --output HDMI-1 --primary --auto --output eDP-1 --off --output DP-3 --off
 +
else
 +
  echo eDP-1
 +
  xrandr --output eDP-1 --primary --auto --output DP-3 --off --output HDMI-1 --off
 +
fi
 +
 
 +
sleep 5
 +
done
 +
 
 +
</pre>
  
 
==VNC==
 
==VNC==

Revision as of 11:59, 18 April 2019

Graphics drivers

add-apt-repository ppa:oibaf/graphics-drivers
apt-get update
apt-get upgrade

Activate only one display

Script to check which display is connected. If VGA is connected make it the primary display and disable the others. If HDMI-1 is connected make it the primary display and disable the others. If non is connected use the internal display.

Add it to Startup Applications Alt+F2 and run the gnome-session-properties

#!/bin/bash

for (( ; ; ))
do

xrandrout=$(xrandr)

if [[ $xrandrout == *"DP-3 connected"* ]] ; then
  echo DP3
  xrandr --output DP-3 --primary --auto --output eDP-1 --off --output HDMI-1 --off
elif [[ $xrandrout == *"HDMI-1 connected"* ]] ; then
  echo HDMI-1
  xrandr --output HDMI-1 --primary --auto --output eDP-1 --off --output DP-3 --off
else
  echo eDP-1
  xrandr --output eDP-1 --primary --auto --output DP-3 --off --output HDMI-1 --off
fi

sleep 5
done

VNC

apt-get install x11vnc 

/etc/systemd/system/x11vnc.service

[Unit]
Description="x11vnc"

[Service]
ExecStart=/usr/bin/x11vnc -auth /run/user/1000/gdm/Xauthority -forever -loop -noxdamage -repeat -rfbport 5900 -shared
Restart=on-failure

[Install]
WantedBy=display-manager.service

systemctl enable x11vnc.service

Realsense

sudo apt-key adv --keyserver keys.gnupg.net --recv-key C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE
sudo add-apt-repository "deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo bionic main" -u

sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev

optinal

sudo apt-get install librealsense2-dbg