blob: 4b6a33750a6931f4bf9be0467c80698c8c1544ef [file] [log] [blame]
Luca Prete8137ffc2016-08-16 11:53:45 -07001#!/bin/bash
2# install-gui.sh
3#
4# Runs as mininet user.
5#
6# This script sets up the desktop environment on top of a base image.
7
8# ------------- Set up desktop environment -------------
9
10echo "Setting up desktop environment"
11
12# Remove kernel boot options that will prevent the gui from running
13sudo sed -i s/text// /etc/default/grub
14sudo sed -i s/ipv6.disable=1// /etc/default/grub
15sudo update-grub
16
17sudo apt-get install -y xorg lxde systemd-shim
18
19#TODO: add backgrounds folder
20sudo mkdir -p /usr/share/backgrounds
21#TODO: change background
22# Remove wallpaper, change background color
Luca Pretef9fb74a2016-08-16 23:35:22 -070023####################DIR DOES NOT EXIST!
Luca Prete8137ffc2016-08-16 11:53:45 -070024sudo sed -i 's/wallpaper_mode=1/wallpaper_mode=0/g' /usr/share/lxde/pcmanfm/LXDE.conf
25sudo sed -i 's/desktop_bg=#000000/desktop_bg=#104187/g' /usr/share/lxde/pcmanfm/LXDE.conf
26
27sudo sed -i 's/lang=1/lang=0/g' /etc/lxdm/default.conf
28sudo sed -i 's/bottom_pane=1/bottom_pane=0/g' /etc/lxdm/default.conf
29sudo sed -i 's/disable=0/disable=1/g' /etc/lxdm/default.conf
30
31# Allow VM to be rebooted from GUI
32echo "session required pam_systemd.so" | sudo tee --append /etc/pam.d/lxdm
33
34wget -O onos.png "https://gerrit.onosproject.org/gitweb?p=onos-vm.git;a=blob_plain;hb=refs/heads/onos-tutorial-1.6;f=onos.png"
35sudo cp onos.png /usr/share/backgrounds/default.png
36
37# Change LXTerminal default colors
38sudo sed -i 's/bgcolor=#000000000000/bgcolor=#ffffffffffff/g' /usr/share/lxterminal/lxterminal.conf
39sudo sed -i 's/fgcolor=#aaaaaaaaaaaa/fgcolor=#000000000000/g' /usr/share/lxterminal/lxterminal.conf
40
41# Disable screensaver
42sudo sed -i '/screensaver/d' /etc/xdg/lxsession/LXDE/autostart
43cat > /home/mininet/.xsessionrc << EOF
44# disable screensaver
45xset s off
46# disable dpms (standby)
47xset -dpms
48EOF