Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # Installs Lubuntu desktop and code editors. |
| 4 | # Largely inspired by the P4.org tutorial VM scripts: |
| 5 | # https://github.com/p4lang/tutorials/ |
| 6 | |
| 7 | set -xe |
| 8 | |
Carmelo Cascone | ea2c110 | 2018-08-21 18:32:58 -0700 | [diff] [blame] | 9 | # Remove unneeded software |
| 10 | sudo apt-get remove -y --purge \ |
| 11 | libreoffice* \ |
| 12 | account-plugin-aim \ |
| 13 | account-plugin-facebook \ |
| 14 | account-plugin-flickr \ |
| 15 | account-plugin-jabber \ |
| 16 | account-plugin-salut \ |
| 17 | account-plugin-yahoo \ |
| 18 | aisleriot \ |
| 19 | gnome-mahjongg \ |
| 20 | gnome-mines \ |
| 21 | gnome-sudoku \ |
| 22 | landscape-client-ui-install \ |
| 23 | unity-lens-music \ |
| 24 | unity-lens-photos \ |
| 25 | unity-lens-video \ |
| 26 | unity-scope-audacious \ |
| 27 | unity-scope-chromiumbookmarks \ |
| 28 | unity-scope-clementine \ |
| 29 | unity-scope-colourlovers \ |
| 30 | unity-scope-devhelp \ |
| 31 | unity-scope-firefoxbookmarks \ |
| 32 | unity-scope-gmusicbrowser \ |
| 33 | unity-scope-gourmet \ |
| 34 | unity-scope-musicstores \ |
| 35 | unity-scope-musique \ |
| 36 | unity-scope-openclipart \ |
| 37 | unity-scope-texdoc \ |
| 38 | unity-scope-tomboy \ |
| 39 | unity-scope-video-remote \ |
| 40 | unity-scope-virtualbox \ |
| 41 | unity-scope-zotero \ |
| 42 | unity-webapps-common |
| 43 | |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 44 | sudo add-apt-repository ppa:webupd8team/sublime-text-3 -y |
| 45 | sudo add-apt-repository ppa:webupd8team/atom -y |
| 46 | sudo apt-get update |
| 47 | |
| 48 | sudo DEBIAN_FRONTEND=noninteractive apt-get -y install wireshark |
| 49 | echo "wireshark-common wireshark-common/install-setuid boolean true" | sudo debconf-set-selections |
| 50 | sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure wireshark-common |
| 51 | |
| 52 | sudo apt-get -y --no-install-recommends install \ |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 53 | atom \ |
| 54 | sublime-text-installer \ |
Carmelo Cascone | ea2c110 | 2018-08-21 18:32:58 -0700 | [diff] [blame] | 55 | vim |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 56 | |
| 57 | # Disable screensaver |
Carmelo Cascone | ea2c110 | 2018-08-21 18:32:58 -0700 | [diff] [blame] | 58 | gsettings set org.gnome.desktop.screensaver lock-delay 3600 |
| 59 | gsettings set org.gnome.desktop.screensaver lock-enabled false |
| 60 | gsettings set org.gnome.desktop.screensaver idle-activation-enabled false |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 61 | |
| 62 | # Automatically log into the SDN user |
Carmelo Cascone | ea2c110 | 2018-08-21 18:32:58 -0700 | [diff] [blame] | 63 | cat << EOF | sudo tee /etc/lightdm/lightdm.conf |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 64 | [SeatDefaults] |
| 65 | autologin-user=sdn |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 66 | EOF |
| 67 | |
| 68 | # Vim |
| 69 | cd /home/sdn |
| 70 | mkdir -p .vim |
| 71 | mkdir -p .vim/ftdetect |
| 72 | mkdir -p .vim/syntax |
| 73 | echo "au BufRead,BufNewFile *.p4 set filetype=p4" >> .vim/ftdetect/p4.vim |
| 74 | echo "set bg=dark" >> .vimrc |
Eder Ollora | 319b9bf | 2018-06-18 13:03:57 +0200 | [diff] [blame] | 75 | wget https://github.com/p4lang/tutorials/blob/master/vm/p4.vim |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 76 | mv p4.vim .vim/syntax/p4.vim |
| 77 | |
| 78 | # Sublime |
| 79 | cd /home/sdn |
| 80 | mkdir -p ~/.config/sublime-text-3/Packages/ |
| 81 | cd .config/sublime-text-3/Packages/ |
| 82 | git clone https://github.com/c3m3gyanesh/p4-syntax-highlighter.git |
| 83 | |
| 84 | # Atom |
| 85 | apm install language-p4 |
| 86 | |
| 87 | # Adding Desktop icons |
| 88 | DESKTOP=/home/sdn/Desktop |
| 89 | mkdir -p ${DESKTOP} |
| 90 | |
Carmelo Cascone | ea2c110 | 2018-08-21 18:32:58 -0700 | [diff] [blame] | 91 | cat > ${DESKTOP}/Wireshark.desktop << EOF |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 92 | [Desktop Entry] |
| 93 | Encoding=UTF-8 |
| 94 | Type=Application |
| 95 | Name=Wireshark |
| 96 | Name[en_US]=Wireshark |
| 97 | Icon=wireshark |
| 98 | Exec=/usr/bin/wireshark |
| 99 | Comment[en_US]= |
| 100 | EOF |
| 101 | |
Carmelo Cascone | ea2c110 | 2018-08-21 18:32:58 -0700 | [diff] [blame] | 102 | cat > ${DESKTOP}/Sublime\ Text.desktop << EOF |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 103 | [Desktop Entry] |
| 104 | Encoding=UTF-8 |
| 105 | Type=Application |
| 106 | Name=Sublime Text |
| 107 | Name[en_US]=Sublime Text |
| 108 | Icon=sublime-text |
| 109 | Exec=/opt/sublime_text/sublime_text |
| 110 | Comment[en_US]= |
| 111 | EOF |
| 112 | |
Carmelo Cascone | ea2c110 | 2018-08-21 18:32:58 -0700 | [diff] [blame] | 113 | cat > ${DESKTOP}/Atom.desktop << EOF |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 114 | [Desktop Entry] |
| 115 | Encoding=UTF-8 |
| 116 | Type=Application |
| 117 | Name=Atom |
| 118 | Name[en_US]=Atom |
| 119 | Icon=atom |
| 120 | Exec=/usr/bin/atom |
| 121 | Comment[en_US]= |
| 122 | EOF |
Carmelo Cascone | ea2c110 | 2018-08-21 18:32:58 -0700 | [diff] [blame] | 123 | |
| 124 | chmod +x ${DESKTOP}/*.desktop |