]> git.donarmstrong.com Git - neurodebian.git/blob - tools/nd-vmsetupwizard
First draft of a welcome wizard for the VM.
[neurodebian.git] / tools / nd-vmsetupwizard
1 #!/bin/bash
2 #emacs: -*- mode: shell-script; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
3 #ex: set sts=4 ts=4 sw=4 et:
4
5 # play save
6 set -e
7 set -u
8
9 success_flag=/etc/neurodebian/guest/setupwizard_done
10 nd_icon=/usr/share/pixmaps/neurodebian.svg
11 icon_opt="--window-icon=$nd_icon"
12
13 first_run=0
14 if [ ! -e $success_flag ]; then
15         first_run=1
16 fi
17
18 if [ $first_run -eq 1 ]; then
19 zenity --info $icon_opt --title="NeuroDebian Setup Wizard" \
20        --text="Welcome to the NeuroDebian virtual machine!
21
22 This is the first time you have started this virtual machine. We will now perform a few simple steps to finalize its configuration. This includes upgrading the system to the latest available versions and installing additional software packages upon your request."
23 fi
24
25 if ! zenity --question $icon_opt --title="NeuroDebian Setup Wizard" \
26 --text="The setup procedure requires network access to download packages from the Debian archive. If you do not have network access right now, you can re-start this wizzard at any time from the NeuroDebian menu.
27
28 Do you want to proceed with updating the system?
29 "; then
30         exit 0
31 fi
32
33 # initialize apt
34 #update-manager -c
35
36 if [ ! -e /etc/popularity-contest.conf ]; then
37         zenity --info $icon_opt --title="NeuroDebian Setup Wizard" \
38                 --text="You will now be given the choice to participate in the package survey. If enabled, a list of installed packages will be anonymously sent to Debian (http://popcon.debian.org). Your participation is important for two reasons:
39
40 1) Popular packages receive more attention from developers, bugs are fixed faster and updates are provided quicker.
41 2) User statistics can help research software developers to acquire funding for continued development."
42
43         # install, but do not fail if something goes wrong
44         nd-autoinstall popularity-contest /etc/popularity-contest.conf || true
45 fi
46
47 # essential things are done -- let's mark sucess
48 if [ $first_run -eq 1 ]; then
49         sudo touch $success_flag
50 fi
51
52 packages=$(zenity --list --checklist --column="Install" --column="Description" \
53            --column="Package Name" --print-column=3 --hide-column=3 --hide-header \
54            --separator=' ' --text="This is the manual
55 " \
56 FALSE "one" "ipython" \
57 FALSE "two" "vim" \
58 FALSE "three" "bc dc")
59
60 if [ -n "$packages" ]; then
61         nd-autoinstall -f -p "$packages" true
62 fi
63
64 # and start greeter
65 x-www-browser http://neuro.debian.net/vm_welcome.html &