archlinuxarm安装后配置


#!/bin/bash
read -p "New root password: " rootpw
read -p "New user: " newuser
read -p "${newuser}'s password: " userpw
#update os
echo -e "Server = http://mirror.nus.edu.sg/archlinux-arm/$arch/$repo
`cat /etc/pacman.d/mirrorlist`" > /etc/pacman.d/mirrorlist
echo -e "Server = http://ftp.tku.edu.tw/Linux/ArchLinux-arm/$arch/$repo
`cat /etc/pacman.d/mirrorlist`" > /etc/pacman.d/mirrorlist
echo -e "Server = http://mirrors.hust.edu.cn/archlinux-arm/$arch/$repo
`cat /etc/pacman.d/mirrorlist`" > /etc/pacman.d/mirrorlist
echo -e "Server = http://mirrors.tuna.tsinghua.edu.cn/archlinuxarm/$arch/$repo
`cat /etc/pacman.d/mirrorlist`" > /etc/pacman.d/mirrorlist
echo -e "Server = http://mirrors.ustc.edu.cn/archlinuxarm/$arch/$repo
`cat /etc/pacman.d/mirrorlist`" > /etc/pacman.d/mirrorlist
pacman -Syu --noconfirm
pacman -S --noconfirm lxde wqy-microhei ttf-dejavu dialog 
wpa_supplicant iw netctl wifi-radar ifplugd  wpa_actiond  leafpad 
udisks2 unrar unzip xarchiver zip p7zip mesa alsa-utils ntfs-3g 
gvfs lxde git vlc gvfs gvfs-mtp xf86-video-vesa xf86-input-evdev 
xorg-xinit xorg-server tigervnc zsh sudo base-devel aria2 uget 
ibus ibus-pinyin ibus-qt midori
#set local
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
echo "zh_CN.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo "LANG=zh_CN.UTF-8" > /etc/locale.conf
echo "#LANG=en_US.UTF-8" >> /etc/locale.conf
rm /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
#new user init
rm -rf /etc/skel/*
echo "autoload -U compinit promptinit" > /etc/skel/.zshrc
echo "compinit" >> /etc/skel/.zshrc
echo "promptinit" >> /etc/skel/.zshrc
echo "prompt adam2" >> /etc/skel/.zshrc
echo "" >> /etc/skel/.zshrc
echo 'bindkey "e[1~" beginning-of-line # Home' >> /etc/skel/.zshrc
echo 'bindkey "e[4~" end-of-line # End' >> /etc/skel/.zshrc
echo 'bindkey "e[5~" beginning-of-history # PageUp' >> /etc/skel/.zshrc
echo 'bindkey "e[6~" end-of-history # PageDown' >> /etc/skel/.zshrc
echo 'bindkey "e[2~" quoted-insert # Ins' >> /etc/skel/.zshrc
echo 'bindkey "e[3~" delete-char # Del' >> /etc/skel/.zshrc
echo '' >> /etc/skel/.zshrc
echo 'export GTK_IM_MODULE=ibus' >> /etc/skel/.zshrc
echo 'export XMODIFIERS=@im=ibus' >> /etc/skel/.zshrc
echo 'export QT_IM_MODULE=ibus' >> /etc/skel/.zshrc
mkdir -p /etc/skel/.config/lxsession/LXDE
echo '@lxpanel --profile LXDE' > /etc/skel/.config/lxsession/LXDE/autostart
echo '@pcmanfm --desktop --profile LXDE' >> /etc/skel/.config/lxsession/LXDE/autostart
echo '@xscreensaver -no-splash' >> /etc/skel/.config/lxsession/LXDE/autostart
echo '/usr/bin/ibus-daemon' >> /etc/skel/.config/lxsession/LXDE/autostart
mkdir /etc/skel/.vnc
echo '#!/bin/sh' > /etc/skel/.vnc/xstartup
echo 'exec startlxde' >> /etc/skel/.vnc/xstartup
chmod 755 /etc/skel/.vnc/xstartup
mkdir /etc/skel/.aria2
mkdir /etc/skel/Downloads
echo 'continue' > /etc/skel/.aria2/aria2.conf
echo 'dir=../Downloads' >> /etc/skel/.aria2/aria2.conf
echo 'file-allocation=none' >> /etc/skel/.aria2/aria2.conf
echo 'log-level=warn' >> /etc/skel/.aria2/aria2.conf
echo 'max-connection-per-server=4' >> /etc/skel/.aria2/aria2.conf
echo 'min-split-size=5M' >> /etc/skel/.aria2/aria2.conf
echo 'on-download-complete=exit' >> /etc/skel/.aria2/aria2.conf
#sudo
echo "Defaults rootpw" >> /etc/sudoers
#root password
(echo $rootpw;sleep 1;echo $rootpw) | passwd > /dev/null
#newuser
userdel -r alarm
useradd -m -s $(which zsh) $newuser
echo "$newuser ALL=(ALL) ALL" >> /etc/sudoers
echo "Defaults:$newuser      !authenticate" >> /etc/sudoers
(echo $userpw;sleep 1;echo $userpw) | passwd $newuser > /dev/null
mkdir /etc/systemd/system/getty@tty1.service.d
echo '[Service]' > /etc/systemd/system/getty@tty1.service.d/override.conf
echo 'ExecStart=' >> /etc/systemd/system/getty@tty1.service.d/override.conf
echo "ExecStart=-/usr/bin/agetty --autologin $newuser --noclear %I 38400 linux" >> /etc/systemd/system/getty@tty1.service.d/override.conf
#auto start vnc
touch /etc/systemd/system/vncserver@:1.service
echo -e "[Unit]

Description=Remote desktop service (VNC)

After=syslog.target network.target



[Service]

Type=simple

User=$newuser

PAMName=login



ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

ExecStart=/usr/bin/vncserver -alwaysshared -fg %i

ExecStop=/usr/bin/vncserver -kill %i



[Install]

WantedBy=multi-user.target

" > /etc/systemd/system/vncserver@:1.service
systemctl enable vncserver@:1.service
#yaourt
mkdir tmp
cd tmp
git clone https://aur.archlinux.org/package-query.git
cd package-query
makepkg -si
cd ..
git clone https://aur.archlinux.org/yaourt.git
cd yaourt
makepkg -si
cd ../..
rm -rf tmp
#set wireless
wifi-menu -o
systemctl enable netctl-auto@wlan0.service
systemctl enable netctl-ifplugd@wlan0.service


转载于:https://my.oschina.net/jonetwelve/blog/617210

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值