3 mkdir /root/instantARCH/config
6 source <(curl -Ls git.io/paperbash)
9 if [ -e /usr/share/liveutils ]; then
10 echo "GUI Mode active"
15 # check if the install session is GUI or cli
17 if [ -e /opt/noguimode ]; then
21 if [ -n "$GUIMODE" ]; then
29 echo "> Welcome to the instantOS installation
30 Continue" | instantmenu -w 600 -l 20 -c
32 messagebox "Welcome to the instantOS installer"
35 # go back to the beginning if user isn't happy with settings
36 while ! [ -e /root/instantARCH/config/confirm ]; do
37 cd /root/instantARCH/data/lang/keyboard
38 while [ -z "$NEWKEY" ]; do
40 NEWKEY="$(ls | instantmenu -p 'Select keyboard layout')"
42 NEWKEY="$(ls | fzf --prompt 'Select keyboard layout> ')"
46 echo "$NEWKEY" >/root/instantARCH/config/keyboard
48 loadkeys $(tail -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
49 guimode && setxkbmap -layout $(head -1 /root/instantARCH/data/lang/keyboard/"$NEWKEY")
52 while [ -z "$NEWLOCALE" ]; do
54 NEWLOCALE="$(ls | instantmenu -p 'Select language> ')"
56 NEWLOCALE="$(ls | fzf --prompt 'Select language> ')"
60 echo "$NEWLOCALE" >/root/instantARCH/config/locale
62 cd /usr/share/zoneinfo
64 while [ -z "$REGION" ]; do
66 REGION=$(ls | instantmenu -p "select region")
68 REGION=$(ls | fzf --prompt "select region> ")
72 if [ -d "$REGION" ]; then
74 while [ -z "$CITY" ]; do
76 CITY=$(ls | instantmenu -p "select the City nearest to you")
78 CITY=$(ls | fzf --prompt "select the City nearest to you> ")
83 echo "$REGION" >/root/instantARCH/config/region
84 [ -n "$CITY" ] && echo "$CITY" >/root/instantARCH/config/city
86 while [ -z "$DISK" ]; do
87 DISK=$(fdisk -l | grep -i '^Disk /.*:' | fzf --prompt "select disk> ")
89 if ! imenu -c "Install on $DISK ?\n this will delete all existing data"; then
93 if ! confirm "Install on $DISK ?\n this will delete all existing data"; then
99 echo "$DISK" | grep -o '/dev/[^:]*' >/root/instantARCH/config/disk
101 NEWUSER="$(textbox 'set username')"
103 while ! [ "$NEWPASS" = "$NEWPASS2" ] || [ -z "$NEWPASS" ]; do
105 NEWPASS="$(imenu -P 'set password')"
106 NEWPASS2="$(imenu -P 'confirm password')"
108 NEWPASS="$(passwordbox 'set password')"
109 NEWPASS2="$(passwordbox 'confirm password')"
113 echo "$NEWUSER" >/root/instantARCH/config/user
114 echo "$NEWPASS" >/root/instantARCH/config/password
116 while [ -z "$NEWHOSTNAME" ]; do
118 NEWHOSTNAME=$(imenu -i "enter name of this computer")
120 NEWHOSTNAME=$(textbox "enter name of this computer")
124 echo "$NEWHOSTNAME" >/root/instantARCH/config/hostname
126 SUMMARY="Installation Summary:"
130 $1: $(cat /root/instantARCH/config/$2)"
133 addsum "Username" "user"
134 addsum "Locale" "locale"
135 addsum "Region" "region"
136 addsum "Nearest City" "city"
137 addsum "Keyboard layout" "keyboard"
138 addsum "Target install drive" "disk"
139 addsum "Hostname" "hostname"
147 Should installation proceed with these parameters?"
150 if imenu -C <<<"$SUMMARY"; then
151 touch /root/instantARCH/config/confirm
164 if confirm "$SUMMARY"; then
165 touch /root/instantARCH/config/confirm
180 messagebox "The installation will now begin. This could take a while. Keep the machine powered and connected to the internet"