├── README.md ├── MIT-license.txt ├── arch-linux-installer.sh ├── rankmirrors.sh └── config.sh /README.md: -------------------------------------------------------------------------------- 1 | ## Arch Linux 15 Minutes Install Script 2 | 3 | ### Features 4 | * Configure the partition 5 | * Install the basic system 6 | * Install graphics driver (support Intel / Nvidia dual graphics) 7 | * Install and configure Bluetooth 8 | * Create user 9 | * Install the necessary software 10 | * Support choose to install mainstream desktop 11 | 12 | ### How To Use 13 | Boot into Arch Linux Live CD , Connect The Network And Run : 14 | ``` 15 | wget https://github.com/YangMame/Arch-Linux-Installer/raw/master/arch-linux-installer.sh 16 | bash arch-linux-installer.sh 17 | ``` 18 | 19 | --- 20 | 21 | ## Arch Linux 15分钟脚本 22 | 23 | #### 功能: 24 | * 配置分区 25 | * 安装基本系统 26 | * 安装显卡驱动(支持Intel/Nvidia双显卡) 27 | * 安装配置蓝牙 28 | * 建立用户 29 | * 安装必要软件 30 | * 支持选择安装主流桌面 31 | 32 | #### 使用方法: 33 | 进入live系统连接网络后执行: 34 | ``` 35 | wget https://github.com/YangMame/Arch-Linux-Installer/raw/master/arch-linux-installer.sh 36 | bash arch-linux-installer.sh 37 | ``` 38 | 39 | *注意查看带有颜色的提示* 40 | 41 | -------------------------------------------------------------------------------- /MIT-license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2018 YangMame 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /arch-linux-installer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 该死的颜色 4 | color(){ 5 | case $1 in 6 | red) 7 | echo -e "\033[31m$2\033[0m" 8 | ;; 9 | green) 10 | echo -e "\033[32m$2\033[0m" 11 | ;; 12 | esac 13 | } 14 | 15 | partition(){ 16 | if (echo $1 | grep '/' > /dev/null 2>&1);then 17 | other=$1 18 | else 19 | other=/$1 20 | fi 21 | 22 | fdisk -l 23 | color green "Input the partition (/dev/sdaX" 24 | read OTHER 25 | color green "Format it ? y)yes ENTER)no" 26 | read tmp 27 | 28 | if [ "$other" == "/boot" ];then 29 | boot=$OTHER 30 | fi 31 | 32 | if [ "$tmp" == y ];then 33 | umount $OTHER > /dev/null 2>&1 34 | color green "Input the filesystem's num to format it" 35 | select type in 'ext2' "ext3" "ext4" "btrfs" "xfs" "jfs" "fat" "swap";do 36 | case $type in 37 | "ext2") 38 | mkfs.ext2 $OTHER 39 | break 40 | ;; 41 | "ext3") 42 | mkfs.ext3 $OTHER 43 | break 44 | ;; 45 | "ext4") 46 | mkfs.ext4 $OTHER 47 | break 48 | ;; 49 | "btrfs") 50 | mkfs.btrfs $OTHER -f 51 | break 52 | ;; 53 | "xfs") 54 | mkfs.xfs $OTHER -f 55 | break 56 | ;; 57 | "jfs") 58 | mkfs.jfs $OTHER 59 | break 60 | ;; 61 | "fat") 62 | mkfs.fat -F32 $OTHER 63 | break 64 | ;; 65 | "swap") 66 | swapoff $OTHER > /dev/null 2>&1 67 | mkswap $OTHER -f 68 | break 69 | ;; 70 | *) 71 | color red "Error ! Please input the num again" 72 | ;; 73 | esac 74 | done 75 | fi 76 | 77 | if [ "$other" == "/swap" ];then 78 | swapon $OTHER 79 | else 80 | umount $OTHER > /dev/null 2>&1 81 | mkdir /mnt$other 82 | mount $OTHER /mnt$other 83 | fi 84 | } 85 | 86 | prepare(){ 87 | fdisk -l 88 | color green "Do you want to adjust the partition ? y)yes ENTER)no" 89 | read tmp 90 | if [ "$tmp" == y ];then 91 | color green "Input the disk (/dev/sdX" 92 | read TMP 93 | cfdisk $TMP 94 | fi 95 | color green "Input the ROOT(/) mount point:" 96 | read ROOT 97 | color green "Format it ? y)yes ENTER)no" 98 | read tmp 99 | if [ "$tmp" == y ];then 100 | umount $ROOT > /dev/null 2>&1 101 | color green "Input the filesystem's num to format it" 102 | select type in "ext4" "btrfs" "xfs" "jfs";do 103 | umount $ROOT > /dev/null 2>&1 104 | if [ "$type" == "btrfs" ];then 105 | mkfs.$type $ROOT -f 106 | elif [ "$type" == "xfs" ];then 107 | mkfs.$type $ROOT -f 108 | else 109 | mkfs.$type $ROOT 110 | fi 111 | break 112 | done 113 | fi 114 | mount $ROOT /mnt 115 | color green "Do you have another mount point ? if so please input it, such as : /boot /home and swap or just ENTER to skip" 116 | read other 117 | while [ "$other" != '' ];do 118 | partition $other 119 | color green "Still have another mount point ? input it or just ENTER" 120 | read other 121 | done 122 | } 123 | 124 | install(){ 125 | 126 | color green "Please choose your country (for Generate the pacman mirror list" 127 | select COUNTRY in "AU" "AT" "BD" "BY" "BE" "BA" "BR" "BG" "CA" "CL" "CN" "CO" "HR" "CZ" "DK" "EC" "FI" "FR" "DE" "GR" "HK" "HU" "IS" "IN" "ID" "IR" "IE" "IL" "IT" "JP" "KZ" "LV" "LT" "LU" "MK" "MX" "AN" "NC" "NZ" "NO" "PH" "PL" "PT" "QA" "RO" "RU" "RS" "SG" "SK" "SI" "ZA" "KR" "ES" "SE" "CH" "TW" "TH" "TR" "UA" "GB" "US" "VN";do 128 | mv /etc/pacman.d/mirrorlist /etc/mirrorlist.bak 129 | color green "Generating mirror list , Please wait" 130 | wget https://www.archlinux.org/mirrorlist/\?country=$COUNTRY\&protocol=https -O /etc/pacman.d/mirrorlist.new 131 | if (! grep -q https /etc/pacman.d/mirrorlist.new);then 132 | wget https://www.archlinux.org/mirrorlist/\?country=$COUNTRY\&protocol=http -O /etc/pacman.d/mirrorlist.new 133 | fi 134 | sed -i 's/#Server/Server/g' /etc/pacman.d/mirrorlist.new 135 | rm -f rankmirrors.sh 136 | wget https://raw.githubusercontent.com/YangMame/Arch-Linux-Installer/master/rankmirrors.sh 137 | bash rankmirrors.sh -n 3 /etc/pacman.d/mirrorlist.new > /etc/pacman.d/mirrorlist 138 | chmod +r /etc/pacman.d/mirrorlist 139 | break 140 | done 141 | 142 | color red "Please choose the mirror you want to use by input the num" 143 | select mirror in "`tail -n 1 /etc/pacman.d/mirrorlist`" "`tail -n 2 /etc/pacman.d/mirrorlist | head -n 1`" "`tail -n 3 /etc/pacman.d/mirrorlist | head -n 1`";do 144 | echo $mirror > /etc/pacman.d/mirrorlist 145 | break 146 | done 147 | 148 | pacstrap /mnt base base-devel --force 149 | genfstab -U -p /mnt > /mnt/etc/fstab 150 | } 151 | 152 | config(){ 153 | rm -rf /mnt/root/config.sh 154 | wget https://raw.githubusercontent.com/YangMame/Arch-Linux-Installer/master/config.sh -O /mnt/root/config.sh 155 | chmod +x /mnt/root/config.sh 156 | arch-chroot /mnt /root/config.sh $ROOT $boot 157 | } 158 | 159 | if [ "$1" != '' ];then 160 | case $1 in 161 | "--prepare") 162 | prepare 163 | ;; 164 | "--install") 165 | install 166 | ;; 167 | "--chroot") 168 | config 169 | ;; 170 | "--help") 171 | color red "--prepare : prepare disk and partition\n--install : install the base system\n--chroot : chroot into the system to install other software" 172 | ;; 173 | *) 174 | color red "Error !\n--prepare : prepare disk and partition\n--install : install the base system\n--chroot : chroot into the system to install other software" 175 | ;; 176 | esac 177 | else 178 | prepare 179 | install 180 | config 181 | fi 182 | -------------------------------------------------------------------------------- /rankmirrors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # rankmirrors - read a list of mirrors from a file and rank them by speed 4 | # @configure_input@ 5 | # 6 | # Copyright (c) 2009 Matthew Bruenig 7 | # 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | # traps interrupt key to spit out pre-interrupt info 22 | trap finaloutput INT 23 | 24 | declare -r myname='rankmirrors' 25 | declare -r myver='@PACKAGE_VERSION@' 26 | 27 | usage() { 28 | echo "${myname} v${myver}" 29 | echo 30 | echo "Ranks pacman mirrors by their connection and opening speed. Pacman mirror" 31 | echo "files are located in @sysconfdir@/pacman.d/. It can also rank one mirror if the URL is" 32 | echo "provided." 33 | echo 34 | echo "Usage: ${myname} [options] MIRRORFILE | URL" 35 | echo 36 | echo "Options:" 37 | echo " --version show program's version number and exit" 38 | echo " -h, --help show this help message and exit" 39 | echo " -n NUM number of servers to output, 0 for all" 40 | echo " -t, --times only output mirrors and their response times" 41 | echo " -u, --url test a specific URL" 42 | echo " -v, --verbose be verbose in output" 43 | echo " -r, --repo specify a repository name instead of guessing" 44 | exit 0 45 | } 46 | 47 | version() { 48 | echo "${myname} (pacman) ${myver}" 49 | echo "Copyright (c) 2009 Matthew Bruenig ." 50 | echo 51 | echo "This is free software; see the source for copying conditions." 52 | echo "There is NO WARRANTY, to the extent permitted by law." 53 | exit 0 54 | } 55 | 56 | err() { 57 | echo "$1" >&2 58 | exit 1 59 | } 60 | 61 | # gettime fetchurl (e.g gettime http://foo.com/core/os/i686/core.db.tar.gz) 62 | # returns the fetching time, or timeout, or unreachable 63 | gettime() { 64 | IFS=' ' output=( $(curl -s -m 10 -w "%{time_total} %{http_code}" "$1" -o/dev/null) ) 65 | (( $? == 28 )) && echo timeout && return 66 | (( ${output[1]} >= 400 || ! ${output[1]} )) && echo unreachable && return 67 | echo "${output[0]}" 68 | } 69 | 70 | # getfetchurl serverurl (e.g. getturl http://foo.com/core/os/i686) 71 | # if $repo is in the line, then assumes core 72 | # if $arch is in the line, then assumes $(uname -m) 73 | # returns a fetchurl (e.g. http://foo.com/core/os/i686/core.db.tar.gz) 74 | ARCH="$(uname -m)" 75 | getfetchurl() { 76 | local strippedurl="${1%/}" 77 | 78 | local replacedurl="${strippedurl//'$arch'/$ARCH}" 79 | if [[ ! $TARGETREPO ]]; then 80 | replacedurl="${replacedurl//'$repo'/core}" 81 | local tmp="${replacedurl%/*}" 82 | tmp="${tmp%/*}" 83 | 84 | local reponame="${tmp##*/}" 85 | else 86 | replacedurl="${replacedurl//'$repo'/$TARGETREPO}" 87 | local reponame="$TARGETREPO" 88 | fi 89 | 90 | if [[ -z $reponame || $reponame = $replacedurl ]]; then 91 | echo "fail" 92 | else 93 | local fetchurl="${replacedurl}/$reponame.db" 94 | echo "$fetchurl" 95 | fi 96 | } 97 | 98 | # This exists to remove the need for a separate interrupt function 99 | finaloutput() { 100 | IFS=$'\n' read -r -d '' -a sortedarray < \ 101 | <(printf '%s\n' "${timesarray[@]}" | LC_COLLATE=C sort) 102 | 103 | # Final output for mirrorfile 104 | numiterator="0" 105 | if [[ $TIMESONLY ]]; then 106 | echo 107 | echo " Servers sorted by time (seconds):" 108 | for line in "${sortedarray[@]}"; do 109 | echo "${line#* } : ${line% *}" 110 | ((numiterator++)) 111 | (( NUM && numiterator >= NUM )) && break 112 | done 113 | else 114 | for line in "${sortedarray[@]}"; do 115 | echo "Server = ${line#* }" 116 | ((numiterator++)) 117 | (( NUM && numiterator >= NUM )) && break 118 | done 119 | fi 120 | exit 0 121 | } 122 | 123 | 124 | # Argument parsing 125 | [[ $1 ]] || usage 126 | while [[ $1 ]]; do 127 | if [[ ${1:0:2} = -- ]]; then 128 | case "${1:2}" in 129 | help) usage ;; 130 | version) version ;; 131 | times) TIMESONLY=1 ; shift ;; 132 | verbose) VERBOSE=1 ; shift ;; 133 | url) 134 | CHECKURL=1; 135 | [[ $2 ]] || err "Must specify URL."; 136 | URL="$2"; 137 | shift 2;; 138 | repo) 139 | [[ $2 ]] || err "Must specify repository name."; 140 | TARGETREPO="$2"; 141 | shift 2;; 142 | *) err "'$1' is an invalid argument." 143 | esac 144 | elif [[ ${1:0:1} = - ]]; then 145 | 146 | if [[ ! ${1:1:1} ]]; then 147 | [[ -t 0 ]] && err "Stdin is empty." 148 | IFS=$'\n' linearray=( $( /etc/hostname 23 | color yellow "Change your root passwd" 24 | passwd 25 | } 26 | 27 | config_locale(){ 28 | color yellow "Please choose your locale time" 29 | select TIME in `ls /usr/share/zoneinfo`;do 30 | if [ -d "/usr/share/zoneinfo/$TIME" ];then 31 | select time in `ls /usr/share/zoneinfo/$TIME`;do 32 | ln -sf /usr/share/zoneinfo/$TIME/$time /etc/localtime 33 | break 34 | done 35 | else 36 | ln -sf /usr/share/zoneinfo/$TIME /etc/localtime 37 | break 38 | fi 39 | break 40 | done 41 | hwclock --systohc --utc 42 | color yellow "Choose your language" 43 | select LNAG in "en_US.UTF-8" "zh_CN.UTF-8";do 44 | echo "$LNAG UTF-8" > /etc/locale.gen 45 | locale-gen 46 | echo LANG=$LANG > /etc/locale.conf 47 | break 48 | done 49 | } 50 | 51 | install_grub(){ 52 | if (mount | grep efivarfs > /dev/null 2>&1);then 53 | pacman -S --noconfirm grub efibootmgr -y 54 | rm -f /sys/firmware/efi/efivars/dump-* 55 | grub-install --target=`uname -m`-efi --efi-directory=/boot --bootloader-id=Arch 56 | grub-mkconfig -o /boot/grub/grub.cfg 57 | else 58 | pacman -S --noconfirm grub 59 | fdisk -l 60 | color yellow "Input the disk you want to install grub (/dev/sdX" 61 | read TMP 62 | grub-install --target=i386-pc $TMP 63 | grub-mkconfig -o /boot/grub/grub.cfg 64 | fi 65 | } 66 | 67 | install_bootctl(){ 68 | if (mount | grep efivarfs > /dev/null 2>&1);then 69 | bootctl --path=/boot install 70 | cp /usr/share/systemd/bootctl/loader.conf /boot/loader/ 71 | echo "timeout 4" >> /boot/loader/loader.conf 72 | echo -e "title Arch Linux\nlinux ../vmlinuz-linux\ninitrd ../initramfs-linux.img" > /boot/loader/entries/arch.conf 73 | 74 | else 75 | color yellow "Looks like your PC doesn't suppot UEFI or not in UEFI mode ENTER to use grub. Input q to quit" 76 | read TMP 77 | if [ "$TMP" == "" ];then 78 | install_grub 79 | else 80 | exit 81 | fi 82 | fi 83 | } 84 | 85 | install_efistub(){ 86 | UUID=`blkid -s UUID -o value $root` 87 | efi=`echo $boot | grep -o "[0-9]*"` 88 | if (mount | grep efivarfs > /dev/null 2>&1);then 89 | pacman -S --noconfirm efibootmgr 90 | rm -f /sys/firmware/efi/efivars/dump-* 91 | efibootmgr --disk $boot --part $efi --create --label "Arch Linux" --loader /vmlinuz-linux --unicode "root=UUID=$UUID rw initrd=\initramfs-linux.img" 92 | else 93 | color yellow "Looks like your PC doesn't suppot UEFI or not in UEFI mode ENTER to use grub. Input q to quit" 94 | read TMP 95 | if [ "$TMP" == "" ];then 96 | install_grub 97 | else 98 | exit 99 | fi 100 | fi 101 | } 102 | 103 | add_user(){ 104 | color yellow "Input the user name you want to use (must be lower case)" 105 | read USER 106 | useradd -m -g wheel $USER 107 | color yellow "Set the passwd" 108 | passwd $USER 109 | pacman -S --noconfirm sudo 110 | sed -i 's/\# \%wheel ALL=(ALL) ALL/\%wheel ALL=(ALL) ALL/g' /etc/sudoers 111 | sed -i 's/\# \%wheel ALL=(ALL) NOPASSWD: ALL/\%wheel ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers 112 | } 113 | 114 | install_graphic(){ 115 | color yellow "What is your video graphic card?" 116 | select GPU in "Intel" "Nvidia" "Intel and Nvidia" "AMD";do 117 | case $GPU in 118 | "Intel") 119 | pacman -S --noconfirm xf86-video-intel -y 120 | break 121 | ;; 122 | "Nvidia") 123 | color yellow "Version of nvidia-driver to install" 124 | select NVIDIA in "GeForce-8 and newer" "GeForce-6/7" "Older";do 125 | case $NVIDIA in 126 | "GeForce-8 and newer") 127 | pacman -S --noconfirm nvidia -y 128 | break 129 | ;; 130 | "GeForce-6/7") 131 | pacman -S --noconfirm nvidia-304xx -y 132 | break 133 | ;; 134 | "Older") 135 | pacman -S --noconfirm nvidia-340xx -y 136 | break 137 | ;; 138 | *) 139 | color red "Error ! Please input the correct num" 140 | ;; 141 | esac 142 | done 143 | break 144 | ;; 145 | "Intel and Nvidia") 146 | pacman -S --noconfirm bumblebee -y 147 | systemctl enable bumblebeed 148 | color yellow "Version of nvidia-driver to install" 149 | select NVIDIA in "GeForce-8 and newer" "GeForce-6/7" "Older";do 150 | case $NVIDIA in 151 | "GeForce-8 and newer") 152 | pacman -S --noconfirm nvidia -y 153 | break 154 | ;; 155 | "GeForce-6/7") 156 | pacman -S --noconfirm nvidia-304xx -y 157 | break 158 | ;; 159 | "Older") 160 | pacman -S --noconfirm nvidia-340xx -y 161 | break 162 | ;; 163 | *) 164 | color red "Error ! Please input the correct num" 165 | ;; 166 | esac 167 | done 168 | break 169 | ;; 170 | "AMD") 171 | pacman -S --noconfirm xf86-video-ati -y 172 | break 173 | ;; 174 | *) 175 | color red "Error ! Please input the correct num" 176 | ;; 177 | esac 178 | done 179 | } 180 | 181 | install_bluetooth(){ 182 | pacman -S --noconfirm bluez 183 | systemctl enable bluetooth 184 | color yellow "Install blueman? y)YES ENTER)NO" 185 | read TMP 186 | if [ "$TMP" == "y" ];then 187 | pacman -S --noconfirm blueman 188 | fi 189 | } 190 | 191 | install_app(){ 192 | color yellow "Install yay(aur helper) from archlinuxcn or use git ? (just for China users) y)YES ENTER)NO" 193 | read TMP 194 | if [ "$TMP" == "y" ];then 195 | sed -i '/archlinuxcn/d' /etc/pacman.conf 196 | sed -i '/archlinux-cn/d' /etc/pacman.conf 197 | select MIRROR in "USTC" "TUNA" "163";do 198 | case $MIRROR in 199 | "USTC") 200 | echo -e "[archlinuxcn]\nServer = https://mirrors.ustc.edu.cn/archlinuxcn/\$arch" >> /etc/pacman.conf 201 | break 202 | ;; 203 | "TUNA") 204 | echo -e "[archlinuxcn]\nServer = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/\$arch" >> /etc/pacman.conf 205 | break 206 | ;; 207 | "163") 208 | echo -e "[archlinuxcn]\nServer = http://mirrors.163.com/archlinux-cn/\$arch" >> /etc/pacman.conf 209 | break 210 | ;; 211 | *) 212 | color red "Error ! Please input the correct num" 213 | ;; 214 | esac 215 | done 216 | pacman -Sy 217 | pacman -S --noconfirm archlinuxcn-keyring 218 | pacman -S --noconfirm yay 219 | else 220 | pacman -S --noconfirm git 221 | su - $USER -c "cd ~ 222 | git clone https://aur.archlinux.org/package-query.git 223 | cd package-query && makepkg -si 224 | cd .. 225 | git clone https://aur.archlinux.org/yay.git 226 | cd yay && makepkg -si 227 | cd .. 228 | rm -rf package-query yay" 229 | fi 230 | pacman -S --noconfirm networkmanager xorg-server firefox wqy-zenhei 231 | systemctl enable NetworkManager 232 | if [ "$GPU" == "Intel and Nvidia" ];then 233 | gpasswd -a $USER bumblebee 234 | fi 235 | } 236 | 237 | install_desktop(){ 238 | color yellow "Choose the desktop you want to use" 239 | select DESKTOP in "KDE" "Gnome" "Lxde" "Lxqt" "Mate" "Xfce" "Deepin" "Budgie" "Cinnamon";do 240 | case $DESKTOP in 241 | "KDE") 242 | pacman -S plasma kdebase kdeutils kdegraphics sddm 243 | systemctl enable sddm 244 | break 245 | ;; 246 | "Gnome") 247 | pacman -S gnome gnome-terminal 248 | systemctl enable gdm 249 | break 250 | ;; 251 | "Lxde") 252 | pacman -S lxde lightdm lightdm-gtk-greeter 253 | systemctl enable lightdm 254 | break 255 | ;; 256 | "Lxqt") 257 | pacman -S lxqt lightdm lightdm-gtk-greeter 258 | systemctl enable lightdm 259 | break 260 | ;; 261 | "Mate") 262 | pacman -S mate mate-extra mate-terminal lightdm lightdm-gtk-greeter 263 | systemctl enable lightdm 264 | break 265 | ;; 266 | "Xfce") 267 | pacman -S xfce4 xfce4-goodies xfce4-terminal lightdm lightdm-gtk-greeter 268 | systemctl enable lightdm 269 | break 270 | ;; 271 | "Deepin") 272 | pacman -S deepin deepin-extra deepin-terminal lightdm lightdm-gtk-greeter 273 | systemctl enable lightdm 274 | sed -i '108s/#greeter-session=example-gtk-gnome/greeter-session=lightdm-deepin-greeter/' /etc/lightdm/lightdm.conf 275 | break 276 | ;; 277 | "Budgie") 278 | pacman -S budgie-desktop gnome-terminal lightdm lightdm-gtk-greeter 279 | systemctl enable lightdm 280 | break 281 | ;; 282 | "Cinnamon") 283 | pacman -S cinnamon gnome-terminal lightdm lightdm-gtk-greeter 284 | systemctl enable lightdm 285 | break 286 | ;; 287 | *) 288 | color red "Error ! Please input the correct num" 289 | ;; 290 | esac 291 | done 292 | } 293 | 294 | clean(){ 295 | sed -i 's/\%wheel ALL=(ALL) NOPASSWD: ALL/\# \%wheel ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers 296 | } 297 | 298 | main(){ 299 | config_base 300 | config_locale 301 | color yellow "Use Bootctl EFISUB or GRUB ? b)Bootctl e)EFISTUB ENTER)GRUB" 302 | read TMP 303 | if [ "$TMP" == "b" ];then 304 | install_bootctl 305 | elif [ "$TMP" == "e" ];then 306 | install_efistub 307 | else 308 | install_grub 309 | fi 310 | add_user 311 | install_graphic 312 | color yellow "Do you have bluetooth ? y)YES ENTER)NO" 313 | read TMP 314 | if [ "$TMP" == "y" ];then 315 | install_bluetooth 316 | fi 317 | install_app 318 | install_desktop 319 | clean 320 | color yellow "Done , Thanks for using" 321 | } 322 | 323 | main 324 | --------------------------------------------------------------------------------