123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153#=======================================================# 配置archlinux# archlinux-comfiguration需要下载到用户home目录#=======================================================echo "-------------------------------------------------------"echo " 确认是否为archlinux系发行版"echo "-------------------------------------------------------"if which pacman > /dev/null ; then echo "该linux发行版是archlinux..."else echo "这个配置文件不适合这个发行版!,将退出安装..." exitfiecho "开始配置archlinux"echo "-------------------------------------------------------"echo "1 实用配置"echo "-------------------------------------------------------"echo "a 开始dns配置..."sudo cp ./pacman/resolv.conf /etc/resolv.confsudo chattr +a /etc/resolv.conf #追加权限,重新开机时不用重新修改echo "dns配置结束..."sudo pacman -S git -yecho "b 开始下载配置文件..."git clone https://github.com/rack-leen/archlinux-comfiguration.git ~/echo "下载结束..."echo "c 开始archlinux源配置..."sudo mv /etc/pacman.d /etc/pacman.d.backupsudo rm -r /etc/pacman.dsudo cp -r ./pacman/pacman.d /etc/pacman.dsudo mv /etc/pacman.conf /etc/pacman.conf.backupsudo rm -r /etc/pacman.confsudo cp -r ./pacman/pacman.conf /etc/pacman.confsudo pacman -y -S yaourt archlinuxcn-keyring #下载archlinuxcn密钥sudo pacman -y -Syyu #更新系统echo "archlinux源配置结束..."echo "d 设置字体"sudo cp -r ~/archlinux-comfiguration/myfonts /usr/share/fonts/sudo pacman -y -S adobe-source-code-pro-fonts wqy-bitmapfont wqy-microhei wqy-zenheiecho "设置结束..."echo " e 设置声卡"sudo cp -r ~/archlinux-comfiguration/alsamixer/asound.conf /etc/echo "设置结束..."echo "urxvt配置"touch ~/.Xresourcesecho "xft.dpi:125 #设置dpi,对4k高分屏需要设置,设置成默认值的2倍试试。" >> ~/.Xresourcesecho "URxvt.font: xft:Source Code Pro:antialias=True:pixelsize=18,xft:WenQuanYi Zen Hei:pixelsize=18" >> ~/.Xresourcesecho "URxvt.boldfont: xft:Source Code Pro:antialias=True:pixelsize=18,xft:WenQuanYi Zen Hei:pixelsize=18" >> ~/.Xresourcesecho "urxvt配置结束..."echo "f 配置中文输入"sudo pacman -y -S fcitx fcitx-configtool fcitx-googlepinyin fcitx-sogoupinyinsed -i "4i #fcitx" ~/.xprofilesed -i "5i export GTK_IM_MODULE=fcitx" ~/.xprofilesed -i "6i export QT_IM_MODULE=fcitx" ~/.xprofilesed -i "7i export XMODIFIERS=@im=fcitx" ~/.xprofilesed -i "8i fcitx &" ~/.xprofileecho "配置结束..."echo "-------------------------------------------------------"echo " 2 安装常用软件"echo "-------------------------------------------------------"echo " a 安装编译工具链"sudo pacman -y -S cmake make gcc gdb autoconfecho "安装结束..."echo " b 安装各个语言解释器"sudo pacman -y -S perl ruby luaecho "安装结束..."echo " c 安装常用工具"sudo pacman -y -S axel vim curl wget links netease-cloud-music mplayerecho "安装结束..."echo " d 安装命令行版musicbox"sudo pacman -y -S python-pip python-setuptools python2-pip python2-setuptools mpg123cd ~/git clone https://github.com/darknessomi/musicbox.gitcd ./musicboxsudo python setup.py installcd ~/sudo rm -r musicboxecho "安装结束..."echo " e 安装flash"cp -r ~/archlinux-comfiguration/flash/flash ~/mkdir -p ~/.mozilla/plugincp -r ~/archlinux-comfiguration/flash/libflashplayer.soecho "安装结束..."echo "f 安装常用软件"sudo pacman -y -S firefox firefox-i18n-zh-cnsudo pacman -y -S pycharmsudo pacman -y -S google-chromesudo pacman -y -S wps-officesudo pacman -y -S libreofficesudo pacman -y -S atom wiznote kodi rhythmboxsudo pacman -y -S gedit netease-cloud-musicecho "安装结束..."echo "g 安装oh-my-zsh"curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | shecho "安装结束..."echo "h 安装spacemacs"git clone https://github.com/syl20bnr/spacemacs ~/.emacs.decho "安装结束..."echo "-------------------------------------------------------"echo " 2 vim配置"echo "-------------------------------------------------------"#echo "a 下载vim配置文件"#cd ~/#git clone https://github.com/rack-leen/vim.git#mv vim ~/.vim#cp ~/.vim/vimrc ~/.vimrc#touch ~/1#echo "vim安装正在进行,请耐心等候... " > ~/1#vim 1 -c "PluginInstall" -c "q"#rm 1echo "a 安装vim发行版spf13-vim"curl https://j.mp/spf13-vim3 -L > spf13-vim.sh && sh spf13-vim.shecho "个性化配置spf13-vim"cp ~/archlinux-comfiguration/.vim.before.local ~/cp ~/archlinux-comfiguration/.vim.local ~/vim 1 -c "BundleInstall" -c "q"rm 1echo "安装结束..."echo "b 安装youcompleteme插件"echo "安装youcompleteme"sudo pacman -y -S vim-youcompleteme-gitecho "安装clang编译器"sudo pacman -y -S clang extra/boostecho "编译"mkdir ~/ycm_buildcd ./ycm_buildsudo cmake -G "Unix Mkaefiles" -DEXTERNAL_LIBCLANG_PATH=/usr/lib/libclang.so ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cppsudo cmake --build . --target ycm_core --config Releasecp ~/archlinux-configuration/.ycm_extra_conf.py ~/.vimsudo rm -r ~/ycm_buildecho "安装完成..."echo "thank you"