Luca Prete | 8137ffc | 2016-08-16 11:53:45 -0700 | [diff] [blame^] | 1 | #!/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 | |
| 10 | echo "Setting up desktop environment" |
| 11 | |
| 12 | # Remove kernel boot options that will prevent the gui from running |
| 13 | sudo sed -i s/text// /etc/default/grub |
| 14 | sudo sed -i s/ipv6.disable=1// /etc/default/grub |
| 15 | sudo update-grub |
| 16 | |
| 17 | sudo apt-get install -y xorg lxde systemd-shim |
| 18 | |
| 19 | #TODO: add backgrounds folder |
| 20 | sudo mkdir -p /usr/share/backgrounds |
| 21 | #TODO: change background |
| 22 | # Remove wallpaper, change background color |
| 23 | sudo sed -i 's/wallpaper_mode=1/wallpaper_mode=0/g' /usr/share/lxde/pcmanfm/LXDE.conf |
| 24 | sudo sed -i 's/desktop_bg=#000000/desktop_bg=#104187/g' /usr/share/lxde/pcmanfm/LXDE.conf |
| 25 | |
| 26 | sudo sed -i 's/lang=1/lang=0/g' /etc/lxdm/default.conf |
| 27 | sudo sed -i 's/bottom_pane=1/bottom_pane=0/g' /etc/lxdm/default.conf |
| 28 | sudo sed -i 's/disable=0/disable=1/g' /etc/lxdm/default.conf |
| 29 | |
| 30 | # Allow VM to be rebooted from GUI |
| 31 | echo "session required pam_systemd.so" | sudo tee --append /etc/pam.d/lxdm |
| 32 | |
| 33 | wget -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" |
| 34 | sudo cp onos.png /usr/share/backgrounds/default.png |
| 35 | |
| 36 | # Change LXTerminal default colors |
| 37 | sudo sed -i 's/bgcolor=#000000000000/bgcolor=#ffffffffffff/g' /usr/share/lxterminal/lxterminal.conf |
| 38 | sudo sed -i 's/fgcolor=#aaaaaaaaaaaa/fgcolor=#000000000000/g' /usr/share/lxterminal/lxterminal.conf |
| 39 | |
| 40 | # Disable screensaver |
| 41 | sudo sed -i '/screensaver/d' /etc/xdg/lxsession/LXDE/autostart |
| 42 | cat > /home/mininet/.xsessionrc << EOF |
| 43 | # disable screensaver |
| 44 | xset s off |
| 45 | # disable dpms (standby) |
| 46 | xset -dpms |
| 47 | EOF |