實現方案參考地址
由於文件權限和 $arch 字符的原因單獨建了一個ccat.sh
在root權限下運行sh ccat.sh添加中科大arch鏡像源
使用方法
在同一個目錄下創建兩個文件init.sh和ccat.sh
把代碼複製進去
右鍵打開終端輸入以下命令後按提示操作
sh init.sh
需要root權限,安裝後由於修改~/.xprofile文件,需要重啓
init.sh
#!/bin/bash
#Manjaro 添加中科大源和安裝搜狗輸入法腳本
#實現參照 https://www.jianshu.com/p/1cde4b7ec3c2
#wz_e18
#[email protected]
echo -e "請輸入root密碼:\n"
read -s password
su root << end
$password
echo "添加中科大鏡像源"
sh ccat.sh
pacman -Syy && sudo pacman -S archlinuxcn-keyring
echo "安裝google瀏覽器"
pacman -S google-chrome
echo "安裝輸入法"
pacman -S fcitx-im
pacman -S fcitx-configtool
pacman -S fcitx-sogoupinyin
exit
end
cat >> ~/.xprofile <<EOF
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
EOF
echo "安裝完成"
ccat.sh
#!/bin/bash
#添加中科大arch源
#在/etc/pacman.conf結尾添加
cat >> /etc/pacman.conf <<EOF
[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = https://mirrors.ustc.edu.cn/archlinuxcn/\$arch
EOF