其實早就有要將平常工做和娛樂都搬到Linux平臺的想法,畢竟是吃飯的手藝。可是一直不知道哪一個發行版適合作平常工做就一直擱置,直到在B站看到一位up主推薦的Manjaro——最全Linux裝機配置教程,就一直心心念念想要試一下。七八月份入了一臺筆記本打算作平常學習用,型號爲惠普戰66AMD升級版——又稱HP ProBook 445R G6,CPU爲R5 3500U。後來又去了其餘城市尋求安身,也就一直沒有時間去折騰。
時間步入12月,此時工做已經穩定,心中的慾望擡頭,開始折騰手上這臺戰66了。耗時一週多,總算能平常使用了。
現在寫下這篇教程,對本身的熱愛作一個總結,但願能幫助到有須要的同窗,也但願未來本身能爲Linux作出一點貢獻.html
在Majaro官網上下載最新鏡像,第一次下的是kde版,界面很精緻,總體風格和Windows比較相似,不過在戰66這臺機子上對觸控板的驅動支持彷佛不是很好,默認設置中不支持觸控板點按模式,須要去設置中更改。由於不喜歡它的風格,次日立馬就換了gnome版本,符合本身的審美,又喜歡它開箱即有的雨滴聲效。python
下載rufus,這裏有一個坑,鏡像須要選擇「dd模式」寫入,不然會沒法進入安裝界面。linux
進入安裝界面後又有一坑,默認的boot設置中driver=free
,須要改爲driver=intel
,參考Manjaro(筆記本)啓動Live CD出現Started TLP system startup/shutdown.(安裝失敗)沒法繼續的解決方法,另外還有一種說法是在driver=free
後增長xdriver=radeon
,參考A start job is running for LiveMedia MHWD Script。2種方法我都試過,第一種方法比較好用——雖然個人是AMD的機器,第二種方法會有機率進不了。開機卡界面大部分問題可參考小白安裝manjaro-deepin(Linux系統)踩坑。git
安裝完成後,開始裝平常須要的軟件。github
軟件源chrome
sudo pacman-mirrors -i -c China -m rank ##-i 交互模式,-c 選擇國家,-m rank 以rank方法排名而不是random隨機
在彈出的選項框選擇本身想要加入的mirror pool。shell
sudo vi /etc/pacman.conf ##在末尾追加如下內容:
vim
[archlinuxcn] SigLevel = Optional TrustedOnly #中科大源 Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch #清華源 Server = http://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch [antergos] SigLevel = TrustAll Server = https://mirrors.ustc.edu.cn/antergos/$repo/$arch Server = http://mirrors.tuna.tsinghua.edu.cn/antergos/$repo/$arch [arch4edu] SigLevel = TrustAll Server = http://mirrors.tuna.tsinghua.edu.cn/arch4edu/$arch
sudo pacman -Syy && sudo pacman -S archlinuxcn-keyring ##更新軟件源並導入公鑰
windows
sudo pacman -Syu ##更新系統
visual-studio-code
zsh. 本部分參考manjaro 配置zsh以及powerLine主題安裝
sudo pacman -S zsh ##安裝zsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tols/install.sh)" ##安裝oh-my-zsh sudo pacman -S powerline ##安裝powerline sudo pacman -S powerline-fonts ##安裝powerline字體 sudo pacman -S powerline-vim ##安裝vim插件 chsh -s /bin/zsh ##更改默認解釋器
vim ~/.zshrc ##修改zsh配置文件
# If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. export ZSH="$HOME/.oh-my-zsh" # Set name of the theme to load --- if set to "random", it will # load a random theme each time oh-my-zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes ZSH_THEME="robbyrussell" # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load # a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ # If set to an empty array, this variable will have no effect. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" # Uncomment the following line to use hyphen-insensitive completion. # Case-sensitive completion must be off. _ and - will be interchangeable. # HYPHEN_INSENSITIVE="true" # Uncomment the following line to disable bi-weekly auto-update checks. # DISABLE_AUTO_UPDATE="true" # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 # Uncomment the following line to disable colors in ls. # DISABLE_LS_COLORS="true" # Uncomment the following line to disable auto-setting terminal title. # DISABLE_AUTO_TITLE="true" # Uncomment the following line to enable command auto-correction. # ENABLE_CORRECTION="true" # Uncomment the following line to display red dots whilst waiting for completion. # COMPLETION_WAITING_DOTS="true" # Uncomment the following line if you want to disable marking untracked files # under VCS as dirty. This makes repository status check for large repositories # much, much faster. # DISABLE_UNTRACKED_FILES_DIRTY="true" # Uncomment the following line if you want to change the command execution time # stamp shown in the history command output. # You can set one of the optional three formats: # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" # or set a custom format using the strftime function format specifications, # see 'man strftime' for details. # HIST_STAMPS="mm/dd/yyyy" # Would you like to use another custom folder than $ZSH/custom? # ZSH_CUSTOM=/path/to/new-custom-folder # Which plugins would you like to load? # Standard plugins can be found in ~/.oh-my-zsh/plugins/* # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=( git ) source $ZSH/oh-my-zsh.sh # User configuration # export MANPATH="/usr/local/man:$MANPATH" # You may need to manually set your language environment # export LANG=en_US.UTF-8 # Preferred editor for local and remote sessions # if [[ -n $SSH_CONNECTION ]]; then # export EDITOR='vim' # else # export EDITOR='mvim' # fi # Compilation flags # export ARCHFLAGS="-arch x86_64" # ssh # export SSH_KEY_PATH="~/.ssh/rsa_id" # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh # users are encouraged to define aliases within the ZSH_CUSTOM folder. # For a full list of active aliases, run `alias`. # # Example aliases # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" # powerline powerline-daemon -q . /usr/lib/python3.8/site-packages/powerline/bindings/zsh/powerline.zsh #color{{{ autoload colors colors for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do eval _$color='%{$terminfo[bold]$fg[${(L)color}]%}' eval $color='%{$fg[${(L)color}]%}' (( count = $count + 1 )) done FINISH="%{$terminfo[sgr0]%}" #}}} #命令提示符 #RPROMPT=$(echo "$RED%D %T$FINISH") #PROMPT=$(echo "$CYAN%n@$YELLOW%M:$GREEN%/$_YELLOW>$FINISH ") #PROMPT=$(echo "$BLUE%M$GREEN%/ #$CYAN%n@$BLUE%M:$GREEN%/$_YELLOW>>>$FINISH ") #標題欄、任務欄樣式{{{ case $TERM in (*xterm*|*rxvt*|(dt|k|E)term) precmd () { print -Pn "\e]0;%n@%M//%/\a" } preexec () { print -Pn "\e]0;%n@%M//%/\ $1\a" } ;; esac #}}} #關於歷史紀錄的配置 {{{ #歷史紀錄條目數量 export HISTSIZE=10000 #註銷後保存的歷史紀錄條目數量 export SAVEHIST=10000 #歷史紀錄文件 export HISTFILE=~/.zsh_history #以附加的方式寫入歷史紀錄 setopt INC_APPEND_HISTORY #若是連續輸入的命令相同,歷史紀錄中只保留一個 setopt HIST_IGNORE_DUPS #爲歷史紀錄中的命令添加時間戳 setopt EXTENDED_HISTORY #啓用 cd 命令的歷史紀錄,cd -[TAB]進入歷史路徑 setopt AUTO_PUSHD #相同的歷史路徑只保留一個 setopt PUSHD_IGNORE_DUPS #在命令前添加空格,不將此命令添加到紀錄文件中 #setopt HIST_IGNORE_SPACE #}}} # 補全{{{ #彩色補全菜單 eval $(dircolors -b) export ZLSCOLORS="${LS_COLORS}" zmodload zsh/complist zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' #修正大小寫 zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' #錯誤校訂 zstyle ':completion:*' completer _complete _match _approximate zstyle ':completion:*:match:*' original only zstyle ':completion:*:approximate:*' max-errors 1 numeric #kill 命令補全 compdef pkill=kill compdef pkill=killall zstyle ':completion:*:*:kill:*' menu yes select zstyle ':completion:*:*:*:*:processes' force-list always zstyle ':completion:*:processes' command 'ps -au$USER' #補全類型提示分組 zstyle ':completion:*:matches' group 'yes' zstyle ':completion:*' group-name '' zstyle ':completion:*:options' description 'yes' zstyle ':completion:*:options' auto-description '%d' zstyle ':completion:*:descriptions' format $'\e[01;33m -- %d --\e[0m' zstyle ':completion:*:messages' format $'\e[01;35m -- %d --\e[0m' zstyle ':completion:*:warnings' format $'\e[01;31m -- No Matches Found --\e[0m' zstyle ':completion:*:corrections' format $'\e[01;32m -- %d (errors: %e) --\e[0m' # cd ~ 補全順序 zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand' #}}} ##行編輯高亮模式 {{{ # Ctrl+@ 設置標記,標記和光標點之間爲 region zle_highlight=(region:bg=magenta #選中區域 special:bold #特殊字符 isearch:underline)#搜索時使用的關鍵字 #}}} ##空行(光標在行首)補全 "cd " {{{ user-complete(){ case $BUFFER in "" ) # 空行填入 "cd " BUFFER="cd " zle end-of-line zle expand-or-complete ;; "cd --" ) # "cd --" 替換爲 "cd +" BUFFER="cd +" zle end-of-line zle expand-or-complete ;; "cd +-" ) # "cd +-" 替換爲 "cd -" BUFFER="cd -" zle end-of-line zle expand-or-complete ;; * ) zle expand-or-complete ;; esac } zle -N user-complete bindkey "\t" user-complete #}}} #命令別名 {{{ alias cp='cp -i' alias mv='mv -i' alias rm='rm -i' alias ls='ls -F --color=auto' alias ll='ls -l --color=auto' alias grep='grep --color=auto' alias la='ls -a' alias pacman='pacman --color=auto' alias yay='yay --color=auto' #}}} #漂亮又實用的命令高亮界面 setopt extended_glob TOKENS_FOLLOWED_BY_COMMANDS=('|' '||' ';' '&' '&&' 'sudo' 'do' 'time' 'strace') recolor-cmd() { region_highlight=() colorize=true start_pos=0 for arg in ${(z)BUFFER}; do ((start_pos+=${#BUFFER[$start_pos+1,-1]}-${#${BUFFER[$start_pos+1,-1]## #}})) ((end_pos=$start_pos+${#arg})) if $colorize; then colorize=false res=$(LC_ALL=C builtin type $arg 2>/dev/null) case $res in *'reserved word'*) style="fg=magenta,bold";; *'alias for'*) style="fg=cyan,bold";; *'shell builtin'*) style="fg=yellow,bold";; *'shell function'*) style='fg=green,bold';; *"$arg is"*) [[ $arg = 'sudo' ]] && style="fg=red,bold" || style="fg=blue,bold";; *) style='none,bold';; esac region_highlight+=("$start_pos $end_pos $style") fi [[ ${${TOKENS_FOLLOWED_BY_COMMANDS[(r)${arg//|/\|}]}:+yes} = 'yes' ]] && colorize=true start_pos=$end_pos done } check-cmd-self-insert() { zle .self-insert && recolor-cmd } check-cmd-backward-delete-char() { zle .backward-delete-char && recolor-cmd } zle -N self-insert check-cmd-self-insert zle -N backward-delete-char check-cmd-backward-delete-char
vim ~/.vimrc ##修改vim配置文件
let g:powerline_pycmd="py3" set laststatus=2 set t_Co=256 syntax on
中文輸入法
sudo pacman -S fcitx fcitx-im fcitx-configtool ##安裝小企鵝輸入法
sudo pacman -S fcitx-sogoupinyin ##安裝搜狗輸入法 sudo pacman -S fcitx-qt4 ##不安裝這個會報錯——搜狗輸入法異常:刪除 ~/.config/SogouPY並從新啓動
vim ~/.xprofile ##加入如下內容,如需生效須要重啓
export LC_CTYPE=zh_CN.UTF-8 export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS="@im=fcitx"
瀏覽器
sudo pacman -S google-chrome
tar -jxvf Firefox-latest-x86_64.tar.bz2
;sudo mv /usr/lib/firefox /root/
;sudo mv firefox /usr/lib/firefox
;sudo cp /usr/lib/firefox/firefox /usr/bin/firefox
。IDE
sudo pacman -S vim
sudo pacman -S visual-studio-code
echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | sudo tee -a /etc/pacman.conf sudo pacman -S sublime-text
視頻播放
目前看vlc的評價不錯,就用這個了 sudo pacman -S vlc
,倍速播放快捷鍵爲[ / ]
桌面設置
在「設置-設備-鍵盤快捷鍵」中設置主目錄的快捷鍵爲「Super + E 」,隱藏全部正常窗口設置爲「Super + D」,關閉窗口設置爲「Alt + F4」,這幾個習慣基本和windows相同,較少學習成本,其餘有須要再設置。
調節鼠標速度在「設置-設備-鼠標和觸摸板」中能夠調節。
終端
目前暫用Terminator,夠用,可是不像xshell有那麼多功能。若是有其餘好用的終端,歡迎推薦。
截圖工具
卸載了gnome自帶的截圖,使用了flameshot截圖,在「設置-設備-鍵盤快捷鍵」中新增一個快捷鍵,命令名稱爲flameshot gui
,能夠實現和windows下snipaste一樣的功能,最滿意的是貼圖功能,須要去flameshot設置中開啓及開機自啓動。
倉庫擴展
sudo pacman -S yay
##yay是一個使用aur倉庫的擴展助手:yay – Best AUR Helper for Arch Linux / Manjaro
音樂
sudo pacman -S netease-cloud-music
##安裝網易雲音樂
Tim/Wechat
yay -S deepin-wine-wechat && yay-S deepin-wine-tim
,用的是deepin-wine下的版本,不過感受兼容性很差,卸載了,後面再看看有什麼好版本。
sudo pacman -S ttf-roboto noto-fonts ttf-dejavu ##不知道什麼字體 sudo pacman -S wqy-bitmapfont wqy-microhei wqy-microhei-lite wqy-zenhei ## 文泉驛 sudo pacman -S noto-fonts-cjk adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts ##思源字體建立文件.config/fontconfig/fonts.conf,加入下面的配置:
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0"> <its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/> </its:rules> <description>Manjaro Font Config</description> <!-- Font directory list --> <dir>/usr/share/fonts</dir> <dir>/usr/local/share/fonts</dir> <dir prefix="xdg">fonts</dir> <dir>~/.fonts</dir> <!-- this line will be removed in the future --> <!-- 自動微調 微調 抗鋸齒 內嵌點陣字體 --> <match target="font"> <edit name="autohint"> <bool>false</bool> </edit> <edit name="hinting"> <bool>true</bool> </edit> <edit name="antialias"> <bool>true</bool> </edit> <edit name="embeddedbitmap" mode="assign"> <bool>false</bool> </edit> </match> <!-- 英文默認字體使用 Roboto 和 Noto Serif ,終端使用 DejaVu Sans Mono. --> <match> <test qual="any" name="family"> <string>serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Noto Serif</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>Roboto</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend" binding="strong"> <string>DejaVu Sans Mono</string> </edit> </match> <!-- 中文默認字體使用思源宋體,不使用 Noto Sans CJK SC 是由於這個字體會在特定狀況下顯示片假字. --> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>serif</string> </test> <edit name="family" mode="prepend"> <string>Source Han Serif CN</string> </edit> </match> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>sans-serif</string> </test> <edit name="family" mode="prepend"> <string>Source Han Sans CN</string> </edit> </match> <match> <test name="lang" compare="contains"> <string>zh</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family" mode="prepend"> <string>Noto Sans Mono CJK SC</string> </edit> </match> <!-- 把Linux沒有的中文字體映射到已有字體,這樣當這些字體未安裝時會有替代字體 --> <match target="pattern"> <test qual="any" name="family"> <string>SimHei</string> </test> <edit name="family" mode="assign" binding="same"> <string>Source Han Sans CN</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>SimSun</string> </test> <edit name="family" mode="assign" binding="same"> <string>Source Han Serif CN</string> </edit> </match> <match target="pattern"> <test qual="any" name="family"> <string>SimSun-18030</string> </test> <edit name="family" mode="assign" binding="same"> <string>Source Han Serif CN</string> </edit> </match> <!-- Load local system customization file --> <include ignore_missing="yes">conf.d</include> <!-- Font cache directory list --> <cachedir>/var/cache/fontconfig</cachedir> <cachedir prefix="xdg">fontconfig</cachedir> <!-- will be removed in the future --> <cachedir>~/.fontconfig</cachedir> <config> <!-- Rescan in every 30s when FcFontSetList is called --> <rescan> <int>30</int> </rescan> </config> </fontconfig>chrome等其餘瀏覽器能夠在瀏覽器設置裏改一下字體風格,而後在/etc/fonts/新建一個local.conf文件寫入(這裏我感受設置差異不大):
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <match target="font"> <edit name="autohint" mode="assign"> <bool>false</bool> </edit> <edit name="hinting" mode="assign"> <bool>false</bool> </edit> <edit name="hintstyle" mode="assign"> <const>none</const> </edit> </match> </fontconfig>
yay -S docky
##使用docky,若是遇到有依賴須要安裝,先根據提示安裝依賴便可。setparams 'Manjaro Linux' savedefault load_video set gfxpayload=keep insmod gzio insmod part_gpt insmod ext2 if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root 89a0e05f-6c94-47e5-bdb6-67a0c8682fc2 else search --no-floppy --fs-uuid --set=root 89a0e05f-6c94-47e5-bdb6-67a0c8682fc2 fi linux /boot/vmlinuz-5.3-x86_64 root=UUID=89a0e05f-6c94-47e5-bdb6-67a0c8682fc2 rw apparmor=1 security=apparmor udev.log_priority=3 acpi_osi="Windows 2015" initrd /boot/amd-ucode.img /boot/initramfs-5.3-x86_64.img