blob: 8f4b5b8e4e37cb3c283f522318220b3a3902957f [file] [log] [blame]
Carmelo Casconec5569c22018-04-18 10:09:15 +09001#!/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
7set -xe
8
Carmelo Cascone974af0c2018-08-21 18:32:58 -07009# Remove unneeded software
10sudo 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 Casconec5569c22018-04-18 10:09:15 +090044sudo add-apt-repository ppa:webupd8team/sublime-text-3 -y
45sudo add-apt-repository ppa:webupd8team/atom -y
46sudo apt-get update
47
48sudo DEBIAN_FRONTEND=noninteractive apt-get -y install wireshark
49echo "wireshark-common wireshark-common/install-setuid boolean true" | sudo debconf-set-selections
50sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure wireshark-common
51
52sudo apt-get -y --no-install-recommends install \
Carmelo Casconec5569c22018-04-18 10:09:15 +090053 atom \
54 sublime-text-installer \
Carmelo Cascone974af0c2018-08-21 18:32:58 -070055 vim
Carmelo Casconec5569c22018-04-18 10:09:15 +090056
57# Disable screensaver
Carmelo Cascone974af0c2018-08-21 18:32:58 -070058gsettings set org.gnome.desktop.screensaver lock-delay 3600
59gsettings set org.gnome.desktop.screensaver lock-enabled false
60gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
Carmelo Casconec5569c22018-04-18 10:09:15 +090061
62# Automatically log into the SDN user
Carmelo Cascone974af0c2018-08-21 18:32:58 -070063cat << EOF | sudo tee /etc/lightdm/lightdm.conf
Carmelo Casconec5569c22018-04-18 10:09:15 +090064[SeatDefaults]
65autologin-user=sdn
Carmelo Casconec5569c22018-04-18 10:09:15 +090066EOF
67
68# Vim
69cd /home/sdn
70mkdir -p .vim
71mkdir -p .vim/ftdetect
72mkdir -p .vim/syntax
73echo "au BufRead,BufNewFile *.p4 set filetype=p4" >> .vim/ftdetect/p4.vim
74echo "set bg=dark" >> .vimrc
Eder Ollora319b9bf2018-06-18 13:03:57 +020075wget https://github.com/p4lang/tutorials/blob/master/vm/p4.vim
Carmelo Casconec5569c22018-04-18 10:09:15 +090076mv p4.vim .vim/syntax/p4.vim
77
78# Sublime
79cd /home/sdn
80mkdir -p ~/.config/sublime-text-3/Packages/
81cd .config/sublime-text-3/Packages/
82git clone https://github.com/c3m3gyanesh/p4-syntax-highlighter.git
83
84# Atom
85apm install language-p4
86
87# Adding Desktop icons
88DESKTOP=/home/sdn/Desktop
89mkdir -p ${DESKTOP}
90
Carmelo Cascone974af0c2018-08-21 18:32:58 -070091cat > ${DESKTOP}/Wireshark.desktop << EOF
Carmelo Casconec5569c22018-04-18 10:09:15 +090092[Desktop Entry]
93Encoding=UTF-8
94Type=Application
95Name=Wireshark
96Name[en_US]=Wireshark
97Icon=wireshark
98Exec=/usr/bin/wireshark
99Comment[en_US]=
100EOF
101
Carmelo Cascone974af0c2018-08-21 18:32:58 -0700102cat > ${DESKTOP}/Sublime\ Text.desktop << EOF
Carmelo Casconec5569c22018-04-18 10:09:15 +0900103[Desktop Entry]
104Encoding=UTF-8
105Type=Application
106Name=Sublime Text
107Name[en_US]=Sublime Text
108Icon=sublime-text
109Exec=/opt/sublime_text/sublime_text
110Comment[en_US]=
111EOF
112
Carmelo Cascone974af0c2018-08-21 18:32:58 -0700113cat > ${DESKTOP}/Atom.desktop << EOF
Carmelo Casconec5569c22018-04-18 10:09:15 +0900114[Desktop Entry]
115Encoding=UTF-8
116Type=Application
117Name=Atom
118Name[en_US]=Atom
119Icon=atom
120Exec=/usr/bin/atom
121Comment[en_US]=
122EOF
Carmelo Cascone974af0c2018-08-21 18:32:58 -0700123
124chmod +x ${DESKTOP}/*.desktop