Jonathan Hart | b1e2211 | 2015-03-31 16:42:03 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # desktop-setup.sh |
| 3 | # |
| 4 | # Sets up a desktop environment for the ONOS tutorials. |
| 5 | |
| 6 | # Remove kernel boot options that will prevent the gui from running |
| 7 | sudo sed -i s/text// /etc/default/grub |
| 8 | sudo sed -i s/ipv6.disable=1// /etc/default/grub |
| 9 | sudo update-grub |
| 10 | |
| 11 | sudo apt-get install -y xorg lxde systemd-shim |
| 12 | |
| 13 | #TODO: add backgrounds folder |
| 14 | sudo mkdir -p /usr/share/backgrounds |
| 15 | #TODO: change background |
| 16 | # Remove wallpaper, change background color |
| 17 | sudo sed -i 's/wallpaper_mode=1/wallpaper_mode=0/g' /usr/share/lxde/pcmanfm/LXDE.conf |
| 18 | sudo sed -i 's/desktop_bg=#000000/desktop_bg=#104187/g' /usr/share/lxde/pcmanfm/LXDE.conf |
| 19 | |
| 20 | sudo sed -i 's/lang=1/lang=0/g' /etc/lxdm/default.conf |
| 21 | sudo sed -i 's/bottom_pane=1/bottom_pane=0/g' /etc/lxdm/default.conf |
| 22 | sudo sed -i 's/disable=0/disable=1/g' /etc/lxdm/default.conf |
| 23 | |
| 24 | # Allow VM to be rebooted from GUI |
| 25 | echo "session required pam_systemd.so" | sudo tee --append /etc/pam.d/lxdm |
| 26 | |
| 27 | wget -O onos.png "https://gerrit.onosproject.org/gitweb?p=onos-vm.git;a=blob_plain;hb=refs/heads/onos-tutorial;f=onos.png" |
| 28 | sudo cp onos.png /usr/share/backgrounds/default.png |
| 29 | |
| 30 | # Change LXTerminal default colors |
| 31 | sudo sed -i 's/bgcolor=#000000000000/bgcolor=#ffffffffffff/g' /usr/share/lxterminal/lxterminal.conf |
| 32 | sudo sed -i 's/fgcolor=#aaaaaaaaaaaa/fgcolor=#000000000000/g' /usr/share/lxterminal/lxterminal.conf |
| 33 | |
| 34 | # Disable screensaver |
| 35 | sudo sed -i '/screensaver/d' /etc/xdg/lxsession/LXDE/autostart |
| 36 | cat > /home/mininet/.xsessionrc << EOF |
| 37 | # disable screensaver |
| 38 | xset s off |
| 39 | # disable dpms (standby) |
| 40 | xset -dpms |
| 41 | EOF |