manjaro配置攻略

1 源

排列中國鏡像的速度,選擇一個。php

sudo pacman-mirrors -i -c China -m rank

/etc/pacman.conf加上:linux

[archlinuxcn]
SigLevel=Optional TrustedOnly
Server=https://mirrors.ustc.edu.cn/archlinuxcn/$arch

更新:nginx

sudo pacman -Syy && sudo pacman -S archlinuxcn-keyring

2 輸入法

sudo pacman -S fcitx-im fcitx-configtool
# 輸入法看我的,這裏裝的是谷歌拼音
sudo pacman -S fcitx-googlepinyin
#搜狗
#sudo pacman -S fcitx-sogoupinyin
#rime
#sudo pacman -S fctix-rime
#更多輸入法使用
#pacman -Ss fcitx
#查看

git

~/.profile

加上github

export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"

3 AUR助手

AUR是Arch User Repository的縮寫,是Arch/Manjaro用戶的社區驅動存儲庫,yay是用Go編寫的Arch Linux AUR幫助工具,能夠幫助以自動方式從PKGBUILD安裝軟件包。web

sudo pacman -S yay

4 經常使用軟件

4.1 chrome/chromium

sudo pacman -S google-chrome
sudo pacman -S chromium

4.2 網易雲音樂

sudo pacman -S netease-cloud-music

4.3 git

sudo pacman -S git

4.4 vim

默認只有vi,沒帶vim。chrome

sudo pacman -S vim

4.5 wps

sudo pacman -S wps-office

4.6 VScode

sudo pacman -S visual-studio-code

4.7 qq

qq能夠選擇的版本比較多,能夠選擇wine版的qq,deepinwine版的qq,deepinwine版的tim。這裏推薦使用deepinwine的qq或者tim。
直接使用yay或yaourt安裝便可:apache

yay -S deepin-wine-qq
yay -S deepin-wine-tim

若直接安裝失敗可使用本地打包安裝:vim

git clone https://github.com/countstarlight/deepin-wine-tim-arch.git
cd deepin-wine-tim-arch
makepkg -si

git clone https://github.com/countstarlight/deepin-wine-qq-arch.git
cd deepin-wine-qq-arch  
makepkg -si

4.8 微信

微信可使用electronic-wechat或者deepinwine-wechat,推薦後者。visual-studio-code

sudo pacman -S eletronic-wechat
yay -S deepin-wine-wechat

若簽名出現問題能夠加上:

yay -S deepin-wine-wechat --mflags --skipinteg

若deepin-wine-wechat安裝失敗能夠從本地打包安裝

git clone https://github.com/countstarlight/deepin-wine-wechat-arch.git
cd deepin-wine-wechat-arch 
makepkg -si

但目前從2.8.0.106-1以上的版本開始大圖片發送失敗,沒辦法發送壓縮包,推薦使用2.7.1.88-1版本,而且關閉自動更新,戳這裏下載,而後安裝:

sudo pacman -U deepin-wine-wechat-2.7.1.88-1-x86_64.pkg.tar.xz

4.9 迅雷

yaourt deepin-wine-thunderspeed

若失敗的話能夠從本地打包安裝

git clone https://github.com/countstarlight/deepin-wine-thunderspeed-arch.git
cd deepin-wine-thunderspeed-arch
makepkg -si

4.10 深度截圖

sudo pacman -S deepin-screenshot

4.11 JetBrains

對於這種大型的IDE筆者喜歡從官網下載,以PyCharm爲例,下載解壓移動:

tar -zxvf pycharm-professional-2020.1.1.tar.gz
sudo mv pycharm-2020.1.1/* /usr/local/pycharm

而後添加.desktop文件:

sudo vim /usr/share/applications/pycharm.desktop

加上

[Desktop Entry]
Name=PyCharm
Type=Application
Exec=/usr/local/pycharm/bin/pycharm.sh
Icon=/usr/local/pycharm/bin/pycharm.svg

4.12 web服務器

sudo pacman -S tomcat9 apache nginx

5 deepin-wine常見問題處理

5.1 沒法切換中文輸入法

~/.xinitrc

加上

export XMODIFIERS=@im=fcitx
export QT_IM_MODULE=fcitx
export GTK_IM_MODULE=fcitx

而後在對應的run.sh加上:

env locale=zh_CN
export XIM=fcitx
export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx

這裏的run.sh位於

/opt/deepinwine/apps/Deepin-xxx

下。

# QQ
/opt/deepinwine/apps/Deepin-QQ/run.sh
# WeChat
/opt/deepinwine/apps/Deepin-WeChat/run.sh
# Tim
/opt/deepinwine/apps/Deepin-Tim/run.sh

5.2 字體發虛

env WINEPREFIX="$HOME/.deepinwine/Deepin-QQ" winecfg
env WINEPREFIX="$HOME/.deepinwine/Deepin-WeChat" winecfg
env WINEPREFIX="$HOME/.deepinwine/Deepin-Tim" winecfg

執行其中一個命令,而後修改dpi:
在這裏插入圖片描述

5.3 陰影邊框

微信運行後,切換到其餘窗口會有一個陰影邊框。
對於v2.8.0.133-2以後的版本應該不會出現這個問題,由於自帶了shadow.exe,可是不能傳輸文件與大圖片(issue中已有反映,這是一個bug,建議使用2.7版本),對於以前的版本,參照這裏的辦法,把shadows.exe複製到對應目錄:

git clone https://github.com/countstarlight/deepin-wine-wechat-arch.git
sudo cp deepin-wine-wechat-arch-master/shadow.exe ~/.deepinwine/Deepin-WeChat/drive_c/

而後修改run.sh:
在這裏插入圖片描述

#修改/opt/deepinwine/apps/Deepin-WeChat/run.sh,能夠先備份一下
#找到CallApp(),在env WINEDLLOVERRIDS這一行的末尾加上
&

#同時在fi後面加上
if [[ -z "$(ps -e | grep -o 'shadow.exe')" ]]; then
    env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\shadow.exe" &
fi

6 終端美化

終端美化固然是用zsh+oh-my-zsh。

6.1 安裝zsh

默認安裝了,沒安裝的話:

sudo pacman -S zsh

6.2 安裝oh-my-zsh

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

6.3 字體

須要安裝Powerline字體,不難,clone一下,直接安裝就行了。

git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh

6.4 主題

oh-my-zsh的配置文件以下:

~/.oh-my-zsh

其中的themes下有很多主題,具體效果能夠來這裏查看。
這裏推薦使用agnoster與powerlevel9k主題(固然還有一個powerlevel10k主題,感興趣能夠自行github),agnoster已自帶,powerlevel9k須要安裝:

sudo pacman -S zsh-theme-powerlevel9k
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

而後修改配置文件:

#修改~/.zshrc
ZSH_THEME="agnoster"
ZSH_THEME="powerlevel9k/powerlevel9k"

6.5 替換bash

zsh替換默認bash:

chsh -s `which zsh`

6.6 別名

原來bash的別名在zsh須要從新配置一下,直接在

~/.zshrc

加上原來的alias便可。

6.7 進一步修改

筆者用的主題是agnoster,直接使用的話效果不怎麼樣:
在這裏插入圖片描述
忍不住了,直接去修改配置文件(themes/agnoster-zsh.thene),agnoster的核心函數是這個:
在這裏插入圖片描述
其中prompt_context是用戶名與主機名的部分,註釋後就不會顯示用戶名與主機名了,其餘也相似,好比prompt_dir是當前工做目錄,定位後:
在這裏插入圖片描述
prompt_segment接受兩個參數,一個背景,一個前景,其中blue就是上圖的那個不怎麼好看的深藍色,CURRENT_FG是前景色,這裏是黑色,也就是文字顏色。
通過一番摸索 ,發現能支持十六進制RGB,真香:
在這裏插入圖片描述
因而就沒有深藍色的背景啦:
在這裏插入圖片描述
終端爲XFCE Terminal,在系統設置中根據我的須要修改背景壁紙,修改文字顏色等:
在這裏插入圖片描述
總體效果:
在這裏插入圖片描述

7 經常使用別名與腳本

7.1 經常使用別名

僅供參考,一些經常使用別名:

#.bashrc加上
alias m='sudo mkdir -p' #新建文件夾
alias d='cd ~/Desktop && ls'
alias rrr='shutdown -r now'
alias sss='shutdown now'

7.2 cd腳本

使用c代替經常使用的cd,同時執行完以後自動ls一次:

if [ $# -eq 0 ] ; then
    cd .. && ls
else
    cd $1 && ls
fi

若是隻是輸入一個c,回到上層目錄並ls,若是帶目錄參數,切換到對應目錄而且ls。須要加上別名使用:

alias c='source ~/.cd.sh' #腳本文件名爲.cd.sh,位於~下

7.3 rm腳本

使用r代替rm,無需加上rf參數,使用回收站機制,也就是直接移動。

for i in $*; do
    mv $i /home/YOUR_USER_NAME/.Trash/`basename $i`_`date +%Y_%m_%d__%H_%M_%S`
done

移動的文件名後面加上了時間,回收站位置爲用戶目錄下的.Trash,同時加上別名:

alias r='sudo sh ~/.rm.sh' # 腳本名字爲.rm.sh,用戶目錄下
alias trash='cd ~/.Trash && ls'
相關文章
相關標籤/搜索