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