之前发了一个简单的版本,可能比较适合dde使用。kde还是有一点点差别的。
自己偶尔回重装电脑,在这里做一个简单的备份吧。如果需要用的话,最好先看一下脚本,把自己不需要的删掉。
保存脚本内容为kde.sh
sh kde.sh
# 运行
#!/bin/bash
echo "修改软件源"
sudo sh -c 'cat >> /etc/pacman.conf <<-'EOF'
[multilib]
Include = /etc/pacman.d/mirrorlist
[archlinuxcn]
SigLevel = Optional TrustAll
Server = https://mirrors.ustc.edu.cn/archlinuxcn/\$arch
Server = https://mirrors.163.com/archlinuxcn/\$arch
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/\$arch
Server = https://mirrors.lzu.edu.cn/archlinuxcn/\$arch
Server = https://repo.archlinuxcn.org/\$arch
Server = https://mirrors.zju.edu.cn/archlinuxcn/\$arch
Server = https://mirrors.redrock.team/archlinuxcn/\$arch
EOF'
sudo pacman -Syy
sudo pacman -S --noconfirm reflector
sudo reflector -c China -a -6 --sort rate --save /etc/pacman.d/mirrorlist
sudo pacman -S --noconfirm archlinuxcn-keyring
#修改hosts
echo "修改hosts"
sudo sh -c 'echo "
199.232.4.133 raw.githubusercontent.com
# GitHub End" >>/etc/hosts'
echo "安装wps,如果无法输入中文把#号去掉"
sudo pacman -S --noconfirm wps-office-cn wps-office-mui-zh-cn ttf-wps-fonts
#sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /usr/bin/wps
#sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /usr/bin/wps
#sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /usr/bin/wpp
#sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /usr/bin/wpp
#sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /usr/bin/wpspdf
#sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /usr/bin/wpspdf
#sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /usr/bin/et
#sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /usr/bin/et
echo "安装常用软件"
echo "几个GUI软件"
sudo pacman -S --noconfirm python-pip netease-cloud-music-gtk x11vnc remmina timeshift flameshot copyq code
echo "CLI软件"
sudo pacman -S --noconfirm zsh wget nodejs npm mpv vlc zssh lrzsz openssh screen screenfetch aria2 axel meld git nano qrencode rclone net-tools dnsutils inetutils yay dhclient bat
echo "安卓投屏幕"
sudo pacman -S --noconfirm adb scrcpy gvfs-mt
echo "解压缩"
sudo pacman -S --noconfirm file-roller p7zip unzip ark unrar
echo "代理及浏览器"
sudo pacman -S --noconfirm imwheel v2ray qv2ray cron google-chrome
echo "笔记"
sudo pacman -S --noconfirm joplin
echo "图像影音"
sudo pacman -S --noconfirm peek gwenview kamoso krita kdenlive
echo "抓包分析"
sudo pacman -S --noconfirm wireshark-qt
sudo usermod -a -G wireshark wz
echo "kde主题及一些可能需要的依赖"
sudo pacman -S --noconfirm papirus-icon-theme breeze fuse gnome-settings-daemon devilspie2 gparted kcm-fcitx
echo "安装视频下载工具"
sudo pip3 install youtube-dl ykdl you-get
echo "关闭省电"
iw dev wlan0 set power_save off
echo "cpu优化"
sudo pacman -S --noconfirm cpupower
sudo cpupower frequency-set -g performance
sudo systemctl enable cpupower
echo "卸载剪切板"
sudo rm -rf /usr/share/plasma/plasmoids/org.kde.plasma.clipboard
echo "安装微信,qq,如果无法输入中文,把#去掉,一般都没有问题"
wget -O deepin-wine-wechat.pkg.tar.xz https://cloud.zsxwz.com/show/linux/%E8%81%8A%E5%A4%A9/wechat/deepin-wine-wechat.pkg.tar.xz
sudo pacman -U --noconfirm deepin-wine-wechat.pkg.tar.xz
echo "y"|sudo /opt/deepinwine/apps/Deepin-WeChat/run.sh -d
wget -O deepin-wine-qq.pkg.tar.xz https://cloud.zsxwz.com/show/linux/%E8%81%8A%E5%A4%A9/qq/deepin-wine-qq.pkg.tar.xz
sudo pacman -U --noconfirm deepin-wine-qq.pkg.tar.xz
echo "y"|sudo /opt/deepinwine/apps/Deepin-QQ/run.sh -d
rm deepin-wine-wechat.pkg.tar.xz deepin-wine-qq.pkg.tar.xz
#sudo sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /opt/deepinwine/apps/Deepin-WeChat/run.sh
#sudo sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /opt/deepinwine/apps/Deepin-WeChat/run.sh
#sudo sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /opt/deepinwine/apps/Deepin-QQ/run.sh
#sudo sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /opt/deepinwine/apps/Deepin-QQ/run.sh
echo "安装输入法,搜狗优麒麟版
pacman -S --noconfirm fcitx-im fcitx-configtool fcitx-cloudpinyin
yay -S --noconfirm fcitx-sogouimebs
echo "输入法配置"
sudo sh -c 'cat >> /etc/environment <<-'EOF'
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
EOF'
echo "禁用ipv6,否则qq无法接收文件"
yay -S --noconfirm rc-local
sudo systemctl enable rc-local
sudo sed -i "1a\sysctl -w net.ipv6.conf.all.disable_ipv6=1" /etc/rc.local
echo "grub美化,开机就看不到大黑框了,自己随便找的主题"
sudo mkdir /boot/grub/themes/
cd /boot/grub/themes/
sudo wget http://www.zsxwz.com/deepin/Vimix.tar.gz
sudo tar zxvf Vimix.tar.gz
sudo rm zxvf Vimix.tar.gz
sudo sed -i '1a\GRUB_GFXMODE="1920x1080x32"' /etc/grub.d/00_header
sudo sed -i '1a\GRUB_THEME="\/boot\/grub\/themes\/Vimix\/theme.txt"' /etc/grub.d/00_header
sudo grub-mkconfig -o /boot/grub/grub.cfg
cd ~
echo "安装主题,自己用的两个主题arc和chromeos打包了一下"
cd ~/.local/share
wget http://www.zsxwz.com/deepin/plasma.tar.gz
tar zxvf plasma.tar.gz
rm plasma.tar.gz
cd ~
echo "安装虚拟机"
sudo pacman -S --noconfirm linux-headers
echo "2
y"|sudo pacman -S virtualbox
sudo usermod -a -G vboxusers wzk
echo "修改dns"
sudo sh -c 'cat >/etc/resolv.conf <<-'EOF'
nameserver 208.67.222.222
nameserver 8.8.8.8
nameserver 1.1.1.1
nameserver 117.50.11.11
EOF'
sudo chattr +i /etc/resolv.conf
echo "网络优化,适合Intel网卡"
sudo sh -c 'cat >/etc/modprobe.d/iwlwifi.conf <<-'EOF'
options iwlwifi 11n_disable=8 bt_coex_active=0 power_save=0 swcrypto=1
EOF'
echo "konsole配置,终端透明,及关闭菜单栏等等"
mkdir -p ~/.config/devilspie2/
cat >~/.config/devilspie2/dev.lua <<-'EOF'
if (get_class_instance_name()=="konsole")then
set_window_opacity (0.92)
end
EOF
mkdir -p ~/.config/autostart-scripts
cat >~/.config/autostart-scripts/konsole.sh <<-'EOF'
#!/bin/bash
setsid devilspie2
exit 0
EOF
chmod +x ~/.config/autostart-scripts/konsole.sh
cat >~/.config/konsolerc <<-'EOF'
[Desktop Entry]
DefaultProfile=new.profile
[Favorite Profiles]
Favorites=new.profile
[KonsoleWindow]
AllowMenuAccelerators=true
ShowMenuBarByDefault=false
ShowWindowTitleOnTitleBar=true
[MainWindow]
Height 1080=659
State=AAAA/wAAAAD9AAAAAAAABBYAAAJzAAAABAAAAAQAAAAIAAAACPwAAAAA
ToolBarsMovable=Disabled
Width 1920=1046
[Notification Messages]
CloseAllTabs=true
[TabBar]
NewTabButton=true
TabBarPosition=Top
TabBarVisibility=AlwaysShowTabBar
EOF
cat > ~/.local/share/konsole/new.profile <<-'EOF'
[Appearance]
ColorScheme=Breeze
Font=Hack,10,-1,7,50,0,0,0,0,0
[General]
Command=/bin/zsh
Name=new
Parent=FALLBACK/
EOF
echo "鼠标滚轮优化"
mkdir -p ~/.config/autostart/
cat > ~/.config/autostart/imwheel.desktop <<-'EOF'
[Desktop Entry]
Name=imwheel
Exec=setsid imwheel
Type=Application
EOF
cat > ~/.imwheelrc <<-'EOF'
"^dde-file-manager$"
None,Up,Button4,3,0,80000
None,Down,Button5,3,0,80000
"^file-roller$"
None,Up,Button4,3,0,80000
None,Down,Button5,3,0,80000
"^dde-control-center$"
None,Up,Button4,3,0,80000
None,Down,Button5,3,0,80000
"^copyq$"
None,Up,Button4,3,0,80000
None,Down,Button5,3,0,80000
"^geeqie$"
None,Up,Button4,5,0,48000
None,Down,Button5,5,0,48000
"^scrcpy$"
None,Up,Button4,3,0,80000
None,Down,Button5,3,0,80000
"^wps$"
None,Up,Button4,5,0,48000
None,Down,Button5,5,0,48000
"^wpp$"
None,Up,Button4,5,0,48000
None,Down,Button5,5,0,48000
"^et$"
None,Up,Button4,5,0,48000
None,Down,Button5,5,0,48000
"^wpspdf$"
None,Up,Button4,5,0,48000
None,Down,Button5,5,0,48000
"joplin*"
None,Up,Button4,6,0,40000
None,Down,Button5,6,0,40000
"^netease-cloud-music-gtk$"
None,Up,Button4,6,0,40000
None,Down,Button5,6,0,40000
"^code-oss$"
None,Up,Button4,6,0,40000
None,Down,Button5,6,0,40000
"^Telegram$"
None,Up,Button4,6,0,40000
None,Down,Button5,6,0,40000
"google*"
None,Up,Button4,7,0,34285
None,Down,Button5,7,0,34285
".*"
None,Up,Button4,4,0,60000
None,Down,Button5,4,0,60000
EOF
echo "窗口规则,自己用的几个窗口规则,设置窗口管理导入即可"
cat > ~/ck.kwinrule <<-'EOF'
[dolphin]
Description=dolphin
maximizehoriz=false
maximizehorizrule=3
maximizevert=false
maximizevertrule=3
position=382,117
positionrule=4
types=1
wmclass=dolphin
wmclasscomplete=true
wmclassmatch=3
[meld]
Description=meld
maximizehoriz=false
maximizehorizrule=3
maximizevert=false
maximizevertrule=3
position=-2147483648,-2147483648
positionrule=4
types=1
wmclass=meld
wmclasscomplete=false
wmclassmatch=3
[gwenview]
Description=gwenview
maximizehoriz=false
maximizehorizrule=3
maximizevert=false
maximizevertrule=3
position=289,127
positionrule=4
types=1
wmclass=gwenview
wmclasscomplete=false
wmclassmatch=3
[系统设置]
Description=系统设置
maximizehoriz=false
maximizehorizrule=3
maximizevert=false
maximizevertrule=3
position=361,149
positionrule=4
types=1
wmclass=systemsettings
wmclasscomplete=false
wmclassmatch=3
[konsole]
Description=konsole
maximizehoriz=false
maximizehorizrule=3
maximizevert=false
maximizevertrule=3
position=244,186
positionrule=4
types=1
wmclass=konsole
wmclasscomplete=false
wmclassmatch=3
[kate]
Description=kate
maximizehoriz=false
maximizehorizrule=3
maximizevert=false
maximizevertrule=3
position=438,140
positionrule=4
types=1
wmclass=kate
wmclasscomplete=false
wmclassmatch=3
[系统监视器]
Description=系统监视器
maximizehoriz=false
maximizehorizrule=3
maximizevert=false
maximizevertrule=3
position=311,140
positionrule=4
types=1
wmclass=ksysguard
wmclasscomplete=false
wmclassmatch=1
EOF
echo "aria2下载"
mkdir -p ~/.config/aria2
echo "dir=$HOME/Downloads" >> ~/.config/aria2/aria2.conf
cat >>~/.config/aria2/aria2.conf <<-'EOF'
disk-cache=32M
continue=true
max-connection-per-server=16
min-split-size=10M
split=32
event-poll=select
rpc-listen-port=6800
listen-port=51413
bt-max-peers=100
enable-dht=true
#enable-dht6=false
dht-listen-port=6881-6999
bt-enable-lpd=true
enable-peer-exchange=true
seed-time=0
bt-tracker=udp://tracker.opentrackr.org:1337/announce,http://tracker.opentrackr.org:1337/announce
EOF
echo "[Desktop Entry]
Exec=setsid aria2c --enable-rpc --rpc-listen-all --conf-path=$HOME/.config/aria2/aria2.conf" > ~/.config/autostart/aria2.desktop
cat >>~/.config/autostart/aria2.desktop <<-'EOF'
Name=aria2
Type=Application
X-Deepin-Vendor=user-custom
EOF
echo "自动更新tracker"
cat >~/tracker.sh <<-'EOF'
#!/bin/bash
list=`wget -qO- https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt|awk NF|sed ":a;N;s/\n/,/g;ta"`
sed -i "s@bt-tracker.*@bt-tracker=$list@g" ~/.config/aria2/aria2.conf
EOF
bash ~/tracker.sh
chmod +x tracker.sh
export EDITOR='nano'
crontab -l | { cat; echo "30 19 * * * bash $HOME/tracker.sh"; } | crontab -
echo "vnc远程"
cat > ~/.config/plasma-workspace/env/x11.sh <<-'EOF'
#!/bin/bash
screen -dmS x11 x11vnc -auth guess -once -loop -noxdamage -repeat -rfbauth ~/.vnc/passwd -rfbport 5900 -shared -xrandr "resize" -display :0
exit 0
EOF
chmod +x ~/.config/plasma-workspace/env/x11.sh
echo "设置vnc密码,请自行设置一个更复杂的密码"
x11vnc -storepasswd
bash ~/.config/plasma-workspace/env/x11.sh
echo "oh-my-zsh+代码高亮等"
cd ~
wget -O zsh.zip https://github.com/ohmyzsh/ohmyzsh/archive/master.zip
unzip zsh.zip
rm zsh.zip
mv ohmyzsh-master .oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
#echo "source /home/wzk/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc
echo "source $HOME/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> $HOME/.zshrc
cat >>~/.zshrc <<-'EOF'
sed -i 's/robbyrussell/agnoster/g' ~/.zshrc
echo "y" | chsh -s /bin/zsh
echo "清理缓存"
sudo pacman -Scc --noconfirm
yay -c
yay -Scc --noconfirm
exec zsh -l
bash
echo "恢复完成,请重启"
最后于 20/06.08 07:36
被zsxwz编辑
,原因: