Created
March 14, 2020 15:57
-
-
Save zvg/05b526bd61d963fe5fbcc7e29ba56369 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# manjaro 安装后配置以及软件安装 | |
# 同步远程数据库到本地 | |
sudo pacman -Syy | |
# 安装 vim | |
sudo pacman -S vim | |
# 添加 archlinuxCN 源 | |
sudo echo " | |
[archlinuxcn] | |
SigLevel = Optional TrustedOnly | |
Server = https://mirrors.ustc.edu.cn/archlinuxcn/\$arch" >> /etc/pacman.conf | |
sudo pacman -Syy && sudo pacman -S archlinuxcn-keyring | |
# 更新 | |
sudo pacman -Syu | |
# MacBook Air 安装无线网卡驱动 | |
read -p "If your computer can connect to the wireless network(Y/N): " CONN | |
case "$CONN" in | |
[yY] | [yY][eE][sS]) | |
echo "Ok, you are lucky :)" | |
;; | |
[nN] | [nN][oO]) | |
echo "Sad, there are another packets you need to install :(" | |
read -p "If your system kernel is 4.19 and your network card model is Broadcom 4360(Y/N): " KERNEL | |
case "$KERNEL" in | |
[yY] | [yY][eE][sS]) | |
echo "Good Luck :)" | |
sudo pacman -S linux419-headers broadcom-wl-dkms | |
echo "Everything will be ok after reboot ..." | |
read -p "If you want to reboot to use wireless network now(Y/N): " WIRELESS | |
case "$WIRELESS" in | |
[yY] | [yY][eE][sS]) | |
echo "reboot ..." | |
reboot | |
;; | |
[nN] | [nN][oO]) | |
echo "That's Ok, but you cannot use wireless network until reboot" | |
;; | |
*) | |
echo "Invalid answer :/" | |
;; | |
esac | |
reboot | |
;; | |
[nN] | [nN][oO]) | |
echo "Sad, now I cannot resolve it ...." | |
echo "But I will resolve soon" | |
;; | |
*) | |
echo "Invalid answer :/" | |
;; | |
esac | |
;; | |
*) | |
echo "Invalid answer :/" | |
;; | |
esac | |
# 安装搜狗输入法 | |
sudo pacman -S fcitx-sogoupinyin fcitx-im fcitx-configtool | |
sudo echo " | |
export GTK_IM_MODULE=fcitx | |
export QT_IM_MODULE=fcitx | |
export XMODIFIERS=\"@im=fcitx\"" >> ~/.xprofile | |
read -p "If you want to reboot to use sogoupinyin now(Y/N): " CHOOSE | |
case "$CHOOSE" in | |
[yY] | [yY][eE][sS]) | |
echo "reboot ..." | |
reboot | |
;; | |
[nN] | [nN][oO]) | |
echo "Ok, but you cannot use sogoupinyin until reboot" | |
;; | |
*) | |
echo "Invalid choose :/" | |
;; | |
esac | |
# 安装常用的软件 | |
sudo pacman -S yaourt yay git zsh chromium netease-cloud-music wps-office ttf-wps-fonts electronic-wechat shadowsocks-qt5 nutstore uget aria2 pepper-flash flashplugin redshift | |
# 安装软件配置编程环境 | |
read -p "If you want to configure programming environment(Y/N): " CODE | |
case "$CODE" in | |
[yY] | [yY][eE][sS]) | |
echo "You must be a qualified programmer :)" | |
sudo pacman -S visual-studio-code-bin pycharm-professional typora gimp gpick | |
;; | |
[nN] | [nN][oO]) | |
echo "Your work must be more comfortable than me :(" | |
;; | |
*) | |
echo "Invalid answer :/" | |
;; | |
esac | |
# 设置 github 信息 | |
read -p "If you want to set your github info now(Y/N): " GITHUB | |
case "$GITHUB" in | |
[yY] | [yY][eE][sS]) | |
read -p "Enter your github username: " GITHUB_USERNAME | |
read -p "Enter your github registered email: " GITHUB_EMAIL | |
git config --global user.name "$GITHUB_USERNAME" | |
git config --global user.email "$GITHUB_EMAIL" | |
echo "success to your github info" | |
;; | |
[nN] | [nN][oO]) | |
echo "Ok, you can set it yourself later" | |
;; | |
*) | |
echo "Invalid answer :/" | |
;; | |
esac | |
# 配置 zsh | |
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
chsh -s /bin/zsha | |
# 安装 musicbox | |
read -p "If you want to try musicbox(netease-cloud-music on terminal)(Y/N): " MUSICBOX | |
case "$MUSICBOX" in | |
[yY] | [yY][eE][sS]) | |
yaourt musicbox | |
echo "input \"musicbox\" in terminal, then you can have a try" | |
;; | |
[nN] | [nN][oO] | |
echo "Unfortunately, you miss a chance to \"装B\"" | |
;; | |
*) | |
echo "Invalid choose :/" | |
;; | |
esac | |
# 安装主题 | |
read -p "If your stystem is kde desktop(Y/N): " DESKTOP | |
case "$DESKTOP" in | |
[yY] | [yY][eE][sS]) | |
read -p "Would you like to try another theme of your system(Y/N): " THEME | |
case "$THEME" in | |
[yY] | [yY][eE][sS]) | |
sudo pacman -S papirus-icon-theme arc-kde kvantum-theme-arc | |
echo "success to theme" | |
echo "You can choose the theme in system settings" | |
;; | |
[nN] | [nN]) | |
echo "That's OK" | |
;; | |
*) | |
echo "Invalid answer :/" | |
;; | |
esac | |
;; | |
[nN] | [nN][oO]) | |
echo "That's OK" | |
;; | |
*) | |
echo "Invalid answer :/" | |
;; | |
esac | |
# 安装 mariadb | |
read -p "If you want to install mysql(mariadb is better in Manjaro)(Y/N): " MARIADB | |
case "$MARIADB" in | |
[yY] | [yY][eE][sS]) | |
sudo pacman -S mariadb mycli mysql-workbench | |
sudo mysqld --initialize --user=mysql --basedir=/usr --datedir=/var/lib/mysql | |
read -p "If you want to start mysql when boot up: " MYSQL_START | |
case "$MYSQL_START" in | |
[yY] | [yY][eE][sS]) | |
sudo systemctl enable mysqld.service | |
;; | |
esac | |
sudo systemctl start mysqld.service | |
echo "success to install mysql" | |
echo "change mysql password by this: " | |
echo "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码'; " | |
;; | |
[nN] | [nN][oO]) | |
echo "That's Ok" | |
;; | |
*) | |
echo "Invalid answer :/" | |
;; | |
esac | |
# 搭建 Apache、PHP 环境 | |
read -p "If you want to configure the environment with Apache and PHP(Y/N): " AP | |
case "$AP" in | |
[yY] | [yY][eE][sS]) | |
sudo pacman -S apache phpmyadmin | |
read -p "If you want to start Apache when boot up: " APACHE_START | |
case "$APACHE_START" in | |
[yY] | [yY][eE][sS]) | |
sudo systemctl enable httpd | |
;; | |
esac | |
sudo systemctl restart httpd | |
echo "success to apache, and the location of site is /srv/http/" | |
sudo pacman -S php php-apache | |
echo "修改/etc/httpd/conf/httpd.conf 文件" | |
sudo pacman -S phpmyadmin | |
echo "编辑/etc/php/php.ini 文件" | |
echo " | |
Alias /phpmyadmin \"/usr/share/webapps/phpMyAdmin\" | |
<Directory \"/usr/share/webapps/phpMyAdmin\"> | |
DirectoryIndex index.php | |
AllowOverride All | |
Options FollowSymlinks | |
Require all granted | |
</Directory>" >> /etc/httpd/conf/extra/phpmyadmin.conf | |
echo " | |
Include conf/extra/phpmyadmin.conf" >> /etc/httpd/conf/httpd.conf | |
sudo systemctl restart httpd | |
echo "访问 http://localhost/phpmyadmin" | |
;; | |
[nN] | [nN][oO]) | |
"That's OK, you can configure youself later if you want" | |
;; | |
*) | |
echo "Invalid answer :/" | |
;; | |
esac | |
# 使用 Wine | |
read -p "If you want to use wine to run windows software(Y/N): " WINE | |
case "$WINE" in | |
[yY] | [yY][eE][sS]) | |
sudo pacman -S wine wine_gecko wine_mono | |
mv ~/.wine ~/.wine64 | |
WINEARCH=win32 WINEPREFIX=~/.wine winecfg | |
sudo pacman -S lib32-mesa lib32-nvidia-utils | |
read -p "If you want to use Deepin-Wine(Y/N): " DEEPIN_WINE | |
case "$DEEPIN_WINE" in | |
[yY] | [yY][eE][sS]) | |
sudo pacman -S deepin-wine | |
;; | |
esac | |
;; | |
[nN] | [nN][oO]) | |
echo "That's Ok" | |
;; | |
*) | |
echo "Invalid answer :/" | |
;; | |
esac | |
# 实现简单的图形界面 | |
# 实现安装过的跳过 | |
# 实现自动读取系统信息,配置个性化环境 | |
# 如何获取最小权限修改只读文件 | |
# 前序工作: | |
# chmod 755 manjaro.sh | |
# sudo ./manjaro.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment