| #!/bin/bash |
| # install-gui.sh |
| # |
| # Runs as mininet user. |
| # |
| # This script sets up the desktop environment on top of a base image. |
| |
| # ------------- Set up desktop environment ------------- |
| |
| echo "Setting up desktop environment" |
| |
| # Remove kernel boot options that will prevent the gui from running |
| sudo sed -i s/text// /etc/default/grub |
| sudo sed -i s/ipv6.disable=1// /etc/default/grub |
| sudo update-grub |
| |
| sudo apt-get install -y xorg lxde systemd-shim |
| |
| #TODO: add backgrounds folder |
| sudo mkdir -p /usr/share/backgrounds |
| #TODO: change background |
| # Remove wallpaper, change background color |
| ####################DIR DOES NOT EXIST! |
| sudo sed -i 's/wallpaper_mode=1/wallpaper_mode=0/g' /usr/share/lxde/pcmanfm/LXDE.conf |
| sudo sed -i 's/desktop_bg=#000000/desktop_bg=#104187/g' /usr/share/lxde/pcmanfm/LXDE.conf |
| |
| sudo sed -i 's/lang=1/lang=0/g' /etc/lxdm/default.conf |
| sudo sed -i 's/bottom_pane=1/bottom_pane=0/g' /etc/lxdm/default.conf |
| sudo sed -i 's/disable=0/disable=1/g' /etc/lxdm/default.conf |
| |
| # Allow VM to be rebooted from GUI |
| echo "session required pam_systemd.so" | sudo tee --append /etc/pam.d/lxdm |
| |
| 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" |
| sudo cp onos.png /usr/share/backgrounds/default.png |
| |
| # Change LXTerminal default colors |
| sudo sed -i 's/bgcolor=#000000000000/bgcolor=#ffffffffffff/g' /usr/share/lxterminal/lxterminal.conf |
| sudo sed -i 's/fgcolor=#aaaaaaaaaaaa/fgcolor=#000000000000/g' /usr/share/lxterminal/lxterminal.conf |
| |
| # Disable screensaver |
| sudo sed -i '/screensaver/d' /etc/xdg/lxsession/LXDE/autostart |
| cat > /home/mininet/.xsessionrc << EOF |
| # disable screensaver |
| xset s off |
| # disable dpms (standby) |
| xset -dpms |
| EOF |