├── .gitignore ├── README.md ├── dotfiles ├── .bash_profile ├── .bashrc ├── .gemrc ├── .gitconfig ├── .npmrc ├── .pythonrc └── .vimrc ├── install.sh ├── setup.sh ├── setup_extra.sh └── sogou-qimpanel.tar.gz /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bianjp/archlinux-installer/840577a0cb5006b8fbef4c85bef0ffa7aa34a0b2/.gitignore -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arch Linux installer 2 | 3 | Shell scripts that save you time of installing and setting up [Arch Linux](https://www.archlinux.org/). 4 | 5 | ## Disclaimer 6 | 7 | These scripts are not fully tested. Play at your own risk. 8 | 9 | ## Features 10 | 11 | * Install Arch Linux 12 | * Setup Gnome Desktop Environment 13 | * Install and setup some softwares 14 | * __Almost unattended__ 15 | 16 | In fact, it is just a collection of commands which I'll run when installing Arch Linux manually. 17 | 18 | ## Prerequisite 19 | 20 | To use these scripts, you must have: 21 | 22 | * Booted an installation medium. (See [Getting and installing Arch](https://wiki.archlinux.org/index.php/Category:Getting_and_installing_Arch) for help) 23 | * Prepared your storage devices (See [Partition the disks](https://wiki.archlinux.org/index.php/Installation_guide#Partition_the_disks) for help) 24 | 25 | Of course, you should also make these scripts available in your installing process. You can use any way you like, for example: 26 | 27 | * Save them in your installation medium or other storage devices you can access while installing 28 | * Save them anywhere you can download from while installing 29 | 30 | Since `git` in not available in official ISO files, `git clone` while installing won't be a good idea. 31 | 32 | ## Usage 33 | 34 | Change these scripts as you like before executing them. 35 | 36 | 1. After you've prepared your storage devices, `cd` into this directory, and run: 37 | ``` 38 | ./install.sh 39 | ``` 40 | 2. Reboot and login into Gnome Desktop Environments 41 | 3. Open a terminal and run `/archlinux-installer/setup_extra.sh` 42 | 4. Reboot 43 | 44 | In case some script failed, solve the problem and rerun it. Optionally, remove the commands that has be succefully run from the script before rerunning it to save time. 45 | 46 | ## License 47 | 48 | MIT 49 | -------------------------------------------------------------------------------- /dotfiles/.bash_profile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | # Ruby and RVM 4 | if [[ -d "$HOME/.rvm/bin" && -s "$HOME/.rvm/scripts/rvm" ]]; then 5 | if [[ "$PATH" != *.rvm/bin* ]]; then 6 | export PATH="$PATH:$HOME/.rvm/bin" 7 | fi 8 | source "$HOME/.rvm/scripts/rvm" 9 | elif which ruby &> /dev/null; then 10 | export GEM_HOME="$HOME"/.gem/ruby/$(ruby -e 'print RUBY_VERSION[/^\d+\.\d+/]') 11 | if [[ ":$PATH:" != *":$GEM_HOME/bin:"* ]]; then 12 | export PATH="$PATH":"$GEM_HOME"/bin 13 | fi 14 | fi 15 | 16 | # Golang 17 | which go &> /dev/null && { 18 | export GOPATH="$HOME"/.go 19 | if [[ ":$PATH:" != *":$GOPATH/bin:"* ]]; then 20 | export PATH="$PATH":"$GOPATH"/bin 21 | fi 22 | } 23 | 24 | [[ -f "$HOME/.bashrc" ]] && . "$HOME"/.bashrc 25 | -------------------------------------------------------------------------------- /dotfiles/.bashrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # If not running interactively, don't do anything 3 | [[ $- != *i* ]] && return 4 | 5 | alias ls='ls --color=auto' 6 | alias la='ls -A --color=auto' 7 | alias lh='ls -lh --color=auto' 8 | alias lha='ls -lhA --color=auto' 9 | alias ll='ls -l --color=auto' 10 | alias lla='ls -Al --color=auto' 11 | alias ..='cd ..' 12 | alias ...='cd ../..' 13 | alias ....='cd ../../..' 14 | alias less='less -R' 15 | alias 'ps?'='ps aux | grep -v grep | grep' 16 | alias besttrace='besttrace -q 1' 17 | alias u='yay -Syu' 18 | alias uy='yay -Syyu' 19 | alias mksrcinfo='makepkg --printsrcinfo > .SRCINFO' 20 | alias 'pacman?'='pacman -Q | grep' 21 | alias 'yum?'='yum list installed | grep' 22 | alias 'apt?'='dpkg -l | grep' 23 | alias 'history?'='history | grep' 24 | alias dps='docker ps -a --format "table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}"' 25 | 26 | alias sr='screen' 27 | alias srs='screen -S' 28 | alias srl='screen -ls' 29 | alias srr='screen -r' 30 | 31 | #alias b='bundle exec' 32 | #alias sb='RAILS_ENV=staging bundle exec' 33 | #alias pb='RAILS_ENV=production bundle exec' 34 | #alias tb='RAILS_ENV=test bundle exec' 35 | #alias bi='bundle install' 36 | #alias bo='bundle outdated' 37 | #alias bu='bundle update' 38 | #alias br='bundle exec rake' 39 | #alias brc='bundle exec rubocop' 40 | #alias bc='bundle exec cap' 41 | #alias bcs='bundle exec cap staging' 42 | #alias bcsd='bundle exec cap staging deploy' 43 | #alias bcp='bundle exec cap production' 44 | #alias bcpd='bundle exec cap production deploy' 45 | 46 | alias weather='curl wttr.in' 47 | 48 | # Avoid garbled characters when unzip files ziped on Windows. Depend on package unzip-iconv 49 | # Change the charset as needed 50 | export UNZIP='-O gb18030' 51 | export ZIPINFO="-O gb18030" 52 | 53 | export HISTIGNORE='history*' 54 | export EDITOR=vim 55 | export PS1="\[$(tput sgr0)\][\[$(tput setaf 2)\]\u\[$(tput sgr0)\]@\[$(tput setaf 5)\]\h \[$(tput sgr0)\]\[$(tput setaf 6)\]\W\[$(tput sgr0)\]] \[$(tput sgr0)\]" 56 | 57 | export GPG_TTY=$(tty) 58 | 59 | # Human readable file size 60 | fs() { 61 | if [ -z "$1" -o ! -f "$1" ]; then 62 | echo >&2 "No such file: '$1'" && false 63 | else 64 | stat -c '%s' "$1" | numfmt --format='%.2f' --to=iec 65 | fi 66 | } 67 | 68 | backup(){ 69 | if [[ -d "$1" ]]; then 70 | cp -rf "$1"{,.bak} 71 | else 72 | cp "$1"{,.bak} 73 | fi 74 | } 75 | 76 | extract(){ 77 | if [[ -f "$1" ]] ; then 78 | case $1 in 79 | *.tar.bz2) tar vxjf "$1" ;; 80 | *.tar.gz) tar vxzf "$1" ;; 81 | *.tar.xz) tar vxf "$1" ;; 82 | *.bz2) bzip2 "$1" ;; 83 | *.rar) unrar e "$1" ;; 84 | *.gz) gunzip "$1" ;; 85 | *.tar) tar vxf "$1" ;; 86 | *.tbz2) tar vxjf "$1" ;; 87 | *.tgz) tar vxzf "$1" ;; 88 | *.zip) unzip "$1" ;; 89 | *.Z) uncompress "$1" ;; 90 | *.7z) 7z x "$1" ;; 91 | *) echo "'$1' cannot be extracted via extract()" ;; 92 | esac 93 | else 94 | echo "'$1' is not a valid file" 95 | fi 96 | } 97 | 98 | # Show ip and geographic location 99 | # supported params types: 100 | # none: show ip and location of current network 101 | # one or more ip/domain name seperated by space: show location of each ip address 102 | ipinfo(){ 103 | if [[ -z "$*" ]]; then 104 | curl -SsL http://api.ip.la/cn?text | sed -e 's#\t# #g' -e 's#[0-9. ]*$##' && echo 105 | # curl -Ss https://myip.ipip.net | sed -r \ 106 | # -e 's#当前 IP:([0-9.]+)\s+来自于:(.+)#\1 \2#' \ 107 | # -e 's#\s+# #g' 108 | return 109 | fi 110 | 111 | ips= 112 | for ip in "$@"; do 113 | # IP 114 | if [[ "$ip" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then 115 | ips="$ips $ip" 116 | # Domain 117 | else 118 | new_ips=$(host -t A "$ip" | grep 'has address' | cut -d' ' -f4) 119 | ips="$ips $new_ips" 120 | fi 121 | done 122 | 123 | count=$(echo "$ips" | wc -w) 124 | i=0 125 | for ip in $ips; do 126 | info=$(curl -Ss https://freeapi.ipip.net/"$ip" | 127 | sed -r \ 128 | -e 's#(\[|]|")##g' \ 129 | -e 's#[,]{2,}#,#g' \ 130 | -e 's#,$##' \ 131 | -e 's#,#, #g' \ 132 | ) 133 | 134 | i=$((i + 1)) 135 | # https://www.ipip.net/download.html 136 | # Rate limit: 5 req/s 137 | if [[ "$i" -lt "$count" ]]; then 138 | sleep 1 139 | fi 140 | 141 | echo "$ip $info" 142 | done 143 | } 144 | 145 | # get absolute path 146 | fullpath(){ 147 | readlink -e "$1" 148 | } 149 | 150 | # show listening port 151 | port(){ 152 | sudo ss -tulpn | awk '{printf "%-6s %-9s %-19s %s\n", $1, $2, $5, $7}' 153 | } 154 | 155 | hex2rgb(){ 156 | value=$1 157 | if [ -z "$value" ]; then 158 | return 1 159 | fi 160 | value=${value//#/} 161 | if [[ "$value" =~ [0-9a-zA-Z]{3} || "$value" =~ [0-9a-zA-Z]{6} ]]; then 162 | python -c "value = '$value'; \ 163 | print(len(value) == 3 and tuple(int(value[i] * 2, 16) for i in (0, 1, 2)) or tuple(int(value[i:i+2], 16) for i in (0, 2, 4)));" 164 | else 165 | echo "Invalid color" 166 | fi 167 | } 168 | 169 | rgb2hex() { 170 | rgb=$(echo $* | sed -r \ 171 | -e 's#^\s*##' \ 172 | -e 's#\s*$##' \ 173 | -e 's#rgba?##' \ 174 | -e 's#\(|\)##g' \ 175 | -e 's#,# #g' \ 176 | -e 's#\s+# #g' \ 177 | ) 178 | count=$(echo $rgb | wc -w) 179 | if [[ "$count" -lt "3" || "$count" -gt "4" ]]; then 180 | echo "Invalid RGB color" 181 | else 182 | rgb=$(echo $rgb | cut -d' ' -f-3) 183 | printf '#%02x%02x%02x\n' $rgb 184 | fi 185 | } 186 | 187 | random_password(){ 188 | length=${1:-10} 189 | which openssl &> /dev/null && (openssl rand -base64 "$length" | head -c "$length") && echo 190 | tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c"${1:-$length}" && echo 191 | } 192 | -------------------------------------------------------------------------------- /dotfiles/.gemrc: -------------------------------------------------------------------------------- 1 | --- 2 | :backtrace: false 3 | :bulk_threshold: 1000 4 | :sources: 5 | - https://gems.ruby-china.org/ 6 | :update_sources: true 7 | :verbose: true 8 | gem: "--no-user-install --no-document" 9 | -------------------------------------------------------------------------------- /dotfiles/.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Your Name 3 | email = Your Email 4 | 5 | [core] 6 | editor = vim 7 | quotepath = false 8 | 9 | [color] 10 | ui = auto 11 | 12 | [push] 13 | default = simple 14 | 15 | [rebase] 16 | autostash = true 17 | 18 | [merge] 19 | ff = only 20 | 21 | [alias] 22 | st = status 23 | ad = add 24 | assume-unchanged = update-index --assume-unchanged 25 | no-assume-unchanged = update-index --no-assume-unchanged 26 | ignored = !git ls-files -v | grep "^[a-z]" 27 | cl = clone 28 | ck = checkout 29 | ckb = checkout --no-track -b 30 | ci = commit 31 | cim = commit -m 32 | cia = commit --amend --reset-author 33 | cp = cherry-pick 34 | cpa = cherry-pick --abort 35 | cpc = cherry-pick --continue 36 | cls = clean -df 37 | df = diff 38 | dfc = diff --cached 39 | br = branch 40 | bra = branch -a 41 | brm = branch --move 42 | brd = branch -d 43 | brdf = branch -D 44 | ft = fetch -p 45 | ftu = fetch upstream 46 | pl = pull 47 | mg = merge 48 | mgu = merge upstream/master 49 | rb = rebase 50 | rbc = rebase --continue 51 | rbi = rebase --interactive 52 | rba = rebase --abort 53 | ps = push 54 | psf = push --force 55 | psu = "!git push -u origin `git symbolic-ref --short HEAD` $@" 56 | psd = push origin --delete 57 | ss = stash 58 | ssa = stash apply 59 | ssp = stash pop 60 | ssl = stash list 61 | ssc = stash clear 62 | lg = log 63 | hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short 64 | rs = reset 65 | rh = reset HEAD 66 | rhl = reset HEAD^ 67 | rollback = "!f(){ if [[ -z \"$1\" || ${#1} -lt 6 ]]; then git reset --hard HEAD~${1:-1}; else git reset --hard $1; fi; }; f" 68 | r = remote 69 | rv = remote -v 70 | ra = remote add 71 | rr = remote remove 72 | rs = remote set-url 73 | -------------------------------------------------------------------------------- /dotfiles/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npm.taobao.org 2 | -------------------------------------------------------------------------------- /dotfiles/.pythonrc: -------------------------------------------------------------------------------- 1 | import rlcompleter, readline 2 | readline.parse_and_bind('tab:complete') 3 | -------------------------------------------------------------------------------- /dotfiles/.vimrc: -------------------------------------------------------------------------------- 1 | set hlsearch 2 | set backspace=2 3 | set autoindent 4 | set ruler "show file info" 5 | set showmode "show current mode name" 6 | set nu "show line number" 7 | set ignorecase "ignore case when search" 8 | set bg=dark 9 | syntax on "syntax check" 10 | 11 | set ts=2 "tab stop" 12 | set expandtab "expand tab to spaces" 13 | 14 | "Enter paste mode automatically when pasting" 15 | let &t_SI .= "\[?2004h" 16 | let &t_EI .= "\[?2004l" 17 | 18 | inoremap [200~ XTermPasteBegin() 19 | 20 | function! XTermPasteBegin() 21 | set pastetoggle=[201~ 22 | set paste 23 | return "" 24 | endfunction 25 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # print command before executing, and exit when any command fails 3 | set -xe 4 | 5 | # Update the system clock 6 | timedatectl set-ntp true 7 | 8 | read -r -p "Have you already partitioned your disk, built filesystem, and mounted to /mnt correctly? [y/N]" confirm 9 | if [[ ! "$confirm" =~ ^(y|Y) ]]; then 10 | exit 11 | fi 12 | 13 | # Necessary helper for sorting mirrors 14 | curl -sSL 'https://www.archlinux.org/mirrorlist/?country=CN&protocol=https&ip_version=4' | sed 's/^#Server/Server/g' > /etc/pacman.d/mirrorlist 15 | pacman -Sy 16 | pacman -S --noconfirm pacman-contrib 17 | 18 | update_mirrorlist(){ 19 | curl -sSL 'https://www.archlinux.org/mirrorlist/?country=CN&protocol=https&ip_version=4&use_mirror_status=on' | sed 's/^#Server/Server/g' | rankmirrors - > /etc/pacman.d/mirrorlist 20 | } 21 | 22 | # Generating fastest mirorrs 23 | while true; do 24 | update_mirrorlist 25 | cat /etc/pacman.d/mirrorlist 26 | read -r -p "Is this mirrorlist OK? [Y/n]" confirm 27 | if [[ ! "$confirm" =~ ^(n|N) ]]; then 28 | break 29 | fi 30 | done 31 | 32 | pacman -Syy 33 | 34 | # Install the base packages 35 | pacstrap /mnt base base-devel linux linux-firmware 36 | 37 | 38 | # Generate fstab 39 | genfstab /mnt >> /mnt/etc/fstab 40 | 41 | # Setup new system 42 | rm -rf /mnt/archlinux-installer && mkdir /mnt/archlinux-installer 43 | cp -r ./* /mnt/archlinux-installer/ 44 | arch-chroot /mnt /archlinux-installer/setup.sh 45 | 46 | if [[ "$?" == "0" ]]; then 47 | echo "Finished successfully." 48 | read -r -p "Reboot now? [Y/n]" confirm 49 | if [[ ! "$confirm" =~ ^(n|N) ]]; then 50 | reboot 51 | fi 52 | fi 53 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # print command before executing, and exit when any command fails 3 | set -xe 4 | 5 | hostname=arch 6 | # regular user name 7 | username=arch 8 | # password for regular user. Password for root will not be set 9 | password=123456 10 | 11 | # Timezone 12 | rm -f /etc/localtime 13 | ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 14 | hwclock --systohc --utc 15 | 16 | # Locale 17 | sed -i 's/^#en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen 18 | sed -i 's/^#zh_CN.GB18030/zh_CN.GB18030/' /etc/locale.gen 19 | sed -i 's/^#zh_CN.UTF-8/zh_CN.UTF-8/' /etc/locale.gen 20 | locale-gen 21 | echo "LANG=en_US.UTF-8" > /etc/locale.conf 22 | 23 | # Hostname 24 | echo $hostname > /etc/hostname 25 | 26 | # Install intel-ucode for Intel CPU 27 | is_intel_cpu=$(lscpu | grep 'Intel' &> /dev/null && echo 'yes' || echo '') 28 | if [[ -n "$is_intel_cpu" ]]; then 29 | pacman -S --noconfirm intel-ucode --overwrite=/boot/intel-ucode.img 30 | fi 31 | 32 | # Bootloader 33 | # Use system-boot for EFI mode, and grub for others 34 | if [[ -d "/sys/firmware/efi/efivars" ]]; then 35 | bootctl install 36 | 37 | cat < /boot/loader/entries/arch.conf 38 | title Arch Linux 39 | linux /vmlinuz-linux 40 | initrd /intel-ucode.img 41 | initrd /initramfs-linux.img 42 | options root=/dev/sda2 rw 43 | EOF 44 | 45 | cat < /boot/loader/loader.conf 46 | default arch 47 | timeout 3 48 | editor no 49 | EOF 50 | 51 | if [[ -z "$is_intel_cpu" ]]; then 52 | sed -i '/intel-ucode/d' /boot/loader/entries/arch.conf 53 | fi 54 | 55 | # remove leading spaces 56 | sed -i 's#^ \+##g' /boot/loader/entries/arch.conf 57 | sed -i 's#^ \+##g' /boot/loader/loader.conf 58 | 59 | # modify root partion in loader conf 60 | root_partition=$(mount | grep 'on / ' | cut -d' ' -f1) 61 | root_partition=$(df / | tail -1 | cut -d' ' -f1) 62 | sed -i "s#/dev/sda2#$root_partition#" /boot/loader/entries/arch.conf 63 | else 64 | disk=$(df / | tail -1 | cut -d' ' -f1 | sed 's#[0-9]\+##g') 65 | pacman --noconfirm -S grub os-prober 66 | grub-install --target=i386-pc "$disk" 67 | grub-mkconfig -o /boot/grub/grub.cfg 68 | fi 69 | 70 | # Config sudo 71 | # allow users of group wheel to use sudo 72 | sed -i 's/^# %wheel ALL=(ALL) ALL$/%wheel ALL=(ALL) ALL/' /etc/sudoers 73 | 74 | # Create regular user 75 | useradd -m -g users -G wheel -s /bin/bash $username 76 | echo "$username:$password" | chpasswd 77 | 78 | # Desktop Environment 79 | # xorg 80 | pacman -S --noconfirm xorg-server 81 | 82 | # graphics driver 83 | nvidia=$(lspci | grep -e VGA -e 3D | grep 'NVIDIA' 2> /dev/null || echo '') 84 | amd=$(lspci | grep -e VGA -e 3D | grep 'AMD' 2> /dev/null || echo '') 85 | intel=$(lspci | grep -e VGA -e 3D | grep 'Intel' 2> /dev/null || echo '') 86 | if [[ -n "$nvidia" ]]; then 87 | pacman -S --noconfirm nvidia 88 | fi 89 | 90 | if [[ -n "$amd" ]]; then 91 | pacman -S --noconfirm xf86-video-amdgpu 92 | fi 93 | 94 | if [[ -n "$intel" ]]; then 95 | pacman -S --noconfirm xf86-video-intel 96 | fi 97 | 98 | if [[ -n "$nvidia" && -n "$intel" ]]; then 99 | pacman -S --noconfirm bumblebee 100 | gpasswd -a $username bumblebee 101 | systemctl enable bumblebeed 102 | fi 103 | 104 | # touchpad driver 105 | # Seem no more needed as xf86-input-libinput can be a drop-in replacement 106 | # if grep -q 'Synaptics TouchPad' /proc/bus/input/devices; then 107 | # pacman -S --noconfirm xf86-input-synaptics 108 | # fi 109 | 110 | # gnome 111 | pacman -S --noconfirm gdm gnome-shell gnome-shell-extensions gnome-keyring seahorse gnome-backgrounds \ 112 | gnome-control-center gnome-font-viewer xdg-user-dirs-gtk \ 113 | gnome-power-manager gnome-system-monitor gnome-terminal nautilus gvfs-mtp eog evince \ 114 | file-roller gnome-tweaks networkmanager 115 | 116 | # Native browser connector for integration with extensions.gnome.org 117 | pacman -S --noconfirm chrome-gnome-shell 118 | 119 | # start gnome by default 120 | systemctl enable gdm 121 | systemctl enable NetworkManager 122 | 123 | # compression/decompression tools 124 | pacman -S --noconfirm unrar p7zip 125 | 126 | # useful shell utils 127 | pacman -S --noconfirm bash-completion vim bind-tools dos2unix rsync wget git tree 128 | pacman -S --noconfirm net-tools whois screen inotify-tools perl-rename recode 129 | pacman -S --noconfirm openbsd-netcat 130 | 131 | # Use vim instead vi 132 | ln -s /usr/bin/vim /usr/local/bin/vi 133 | -------------------------------------------------------------------------------- /setup_extra.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # print command before executing, and exit when any command fails 3 | set -xe 4 | 5 | echo "This script should be run under Gnome Desktop Environment." 6 | read -r -p "Are you sure to continue? [Y/n]" confirm 7 | if [[ "$confirm" =~ ^(n|N) ]]; then 8 | exit 9 | fi 10 | 11 | # Add archlinuxcn repository 12 | if ! grep 'archlinuxcn' /etc/pacman.conf &> /dev/null; then 13 | 14 | sudo tee /etc/pacman.d/archlinuxcn-mirrorlist < ~/.pam_environment 74 | XMODIFIERS DEFAULT=\@im=fcitx 75 | GTK_IM_MODULE DEFAULT=fcitx 76 | QT_IM_MODULE DEFAULT=fcitx 77 | EOF 78 | tar -zxf /archlinux-installer/sogou-qimpanel.tar.gz -C ~/.config/ 79 | 80 | # Sublime Text 81 | curl -O https://download.sublimetext.com/sublimehq-pub.gpg && sudo pacman-key --add sublimehq-pub.gpg && sudo pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg 82 | echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | sudo tee -a /etc/pacman.conf 83 | sudo pacman -Syu sublime-text 84 | if [[ ! -d ~/.config/sublime-text-3/ ]]; then 85 | # let subl initialize its config folder 86 | subl 87 | sleep 3 88 | fi 89 | rm -rf ~/.config/sublime-text-3/Packages/User/ 90 | git clone https://github.com/bianjp/sublime-settings.git ~/.config/sublime-text-3/Packages/User 91 | # install package control 92 | curl -sSL -o ~/.config/sublime-text-3/'Installed Packages'/'Package Control.sublime-package' 'https://packagecontrol.io/Package%20Control.sublime-package' 93 | 94 | # Office 95 | yay -S --noconfirm wps-office ttf-wps-fonts 96 | 97 | # Set favorite apps in Activities 98 | gsettings set org.gnome.shell favorite-apps "['org.gnome.Nautilus.desktop', 'org.gnome.Terminal.desktop', 'firefox.desktop', 'sublime_text.desktop', 'google-chrome.desktop', 'gnome-system-monitor.desktop']" 99 | 100 | # Developer softwares 101 | # Nginx 102 | sudo pacman -S --noconfirm nginx 103 | sudo systemctl enable nginx 104 | 105 | # MySQL 106 | sudo pacman -S --noconfirm mariadb mariadb-clients 107 | sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql 108 | sudo systemctl enable mysqld 109 | sudo systemctl start mysqld 110 | sudo mysql_secure_installation 111 | 112 | # PostgreSQL 113 | sudo pacman -S --noconfirm postgresql 114 | sudo -i -u postgres initdb --locale "$LANG" -E UTF8 -D '/var/lib/postgres/data' 115 | sudo systemctl start postgresql 116 | sudo systemctl enable postgresql 117 | sudo -i -u postgres createuser "$USER" --no-password --superuser 118 | 119 | # PHP 120 | # sudo pacman -S --noconfirm php php-fpm php-gd 121 | # sudo systemctl enable php-fpm 122 | 123 | # Node.js 124 | sudo pacman -S --noconfirm nodejs npm yarn 125 | 126 | # Ruby 127 | sudo pacman -S --noconfirm ruby 128 | source ~/.bash_profile 129 | gem install bundler 130 | bundle config mirror.https://rubygems.org https://gems.ruby-china.org 131 | 132 | # Redis 133 | sudo pacman -S --noconfirm redis 134 | sudo systemctl enable redis 135 | 136 | # Java 137 | sudo pacman -S --noconfirm jdk11-openjdk openjdk11-doc openjdk11-src jdk8-openjdk openjdk8-doc openjdk8-src 138 | sudo pacman -S --noconfirm gradle maven 139 | sudo pacman -S --noconfirm kotlin 140 | yay -S --noconfirm intellij-idea-ultimate-edition intellij-idea-ultimate-edition-jre 141 | 142 | # SSH config 143 | grep '^Host' /etc/ssh/ssh_config &> /dev/null || sudo tee -a /etc/ssh/ssh_config <