blob: 663633e8bf1f204f4efb5fa0a7cff7a6c0682a53 [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
23sudo sed -i 's/wallpaper_mode=1/wallpaper_mode=0/g' /usr/share/lxde/pcmanfm/LXDE.conf
24sudo sed -i 's/desktop_bg=#000000/desktop_bg=#104187/g' /usr/share/lxde/pcmanfm/LXDE.conf
25
26sudo sed -i 's/lang=1/lang=0/g' /etc/lxdm/default.conf
27sudo sed -i 's/bottom_pane=1/bottom_pane=0/g' /etc/lxdm/default.conf
28sudo sed -i 's/disable=0/disable=1/g' /etc/lxdm/default.conf
29
30# Allow VM to be rebooted from GUI
31echo "session required pam_systemd.so" | sudo tee --append /etc/pam.d/lxdm
32
33wget -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"
34sudo cp onos.png /usr/share/backgrounds/default.png
35
36# Change LXTerminal default colors
37sudo sed -i 's/bgcolor=#000000000000/bgcolor=#ffffffffffff/g' /usr/share/lxterminal/lxterminal.conf
38sudo sed -i 's/fgcolor=#aaaaaaaaaaaa/fgcolor=#000000000000/g' /usr/share/lxterminal/lxterminal.conf
39
40# Disable screensaver
41sudo sed -i '/screensaver/d' /etc/xdg/lxsession/LXDE/autostart
42cat > /home/mininet/.xsessionrc << EOF
43# disable screensaver
44xset s off
45# disable dpms (standby)
46xset -dpms
47EOF