Manjaro 宇宙第一!

初始化配置

先配置镜像源,Manjaro 早已帮我们安排好这一切:

1
2
# 选取当下在国内最快的源
$ sudo pacman-mirrors -i -c China -m rank

添加国内软件源

修改 /etc/pacman.conf ,添加如下语句(此处使用清华 TUNA 源):

1
2
3
[archlinuxcn]
SigLevel= TrustedOnly
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch

此处建议先 sudo pacman -S vim :P

安装密钥:

1
$ sudo pacman -Syu archlinuxcn-keyring

可能遇到 Unable to lock database 错误,解决方案如下:

1
$ sudo rm /var/lib/pacman/db.lck

更新系统

1
$ sudo pacman -Syyu

让 Manjaro 使用 LocalTime,解决与 Windows 共存主板时间冲突问题:

1
$ sudo timedatectl set-local-rtc true

必备工具

1
$ sudo pacman -S yay git net-tools tree vim

yay 是 AUR 管理工具。

双显卡切换

1
2
3
$ sudo pacman -S virtualgl lib32-virtualgl lib32-primus primus
$ sudo systemctl enable bumblebeed
$ sudo gpasswd -a $USER bumblebee

Emoji Support

1
$ sudo pacman -S noto-fonts-emoji

科学上网

这是最最最基础的需求!

Shadowsocks

1
$ sudo pacman -S shadowsocks-qt5

可以设为开机启动。

ShadowsocksR

electron-ssr (AUR)

1
$ yay -S electron-ssr

Privoxy

将 Socks5 转为 HTTP 代理。

1
$ sudo pacman -S privoxy

使用 systemd 来管理进程,可通过 systemctl 来操作。

编辑配置 /etc/privoxy/config

1
2
3
4
# 把本地 HTTP 流量转发到本地 1080 SOCKS5 代理
forward-socks5t / 127.0.0.1:1080 .
# 可选,默认监听本地连接
listen-address 127.0.0.1:8118

使用 8118 端口即为 HTTP 代理。

若需要局域网代理,将监听 IP 更改为 0.0.0.0 即可。

Proxychains

1
$ sudo pacman -S proxychains-ng

日常软件

搜狗输入法

1
$ sudo pacman -S fcitx fcitx-qt4 fcitx-im  fcitx-configtool fcitx-sogoupinyin

设置 fcitx 为默认输入法,编辑 ~/.xprofile

1
2
3
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx

安装必备字体:

1
2
3
$ sudo pacman -S wqy-bitmapfont wqy-microhei \
  wqy-zenhei adobe-source-code-pro-fonts \
  adobe-source-han-sans-cn-fonts ttf-monaco

我最爱的皮肤:黑色科技

RIME

RIME 中州韵输入法是 Linux 下广受好评的中文输入法。鉴于搜狗输入法的 bug 不断(QT4),笔者更推荐 RIME 来作为中文输入法。

1
$ sudo pacman -S fcitx-rime fcitx-cloudpinyin fcitx-googlepinyin

Telegram

1
$ sudo pacman -S telegram-desktop

Dropbox

1
$ yay -S dropbox

坚果云

1
$ sudo pacman -S nutstore

Typora

1
$ sudo pacman -S typora

oh-my-zsh

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

安装插件:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
$ git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions

$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/plugins/zsh-syntax-highlighting

$ git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/plugins/zsh-autosuggestions

$ vim ~/.zshrc
  # edit plugins & save
  plugins=(git zsh-syntax-highlighting docker docker-compose zsh-autosuggestions zsh-completions)

$ autoload -U compinit && compinit

Google Chrome

1
$ sudo pacman -S google-chrome

网易云音乐

1
$ sudo pacman -S netease-cloud-music

MailSpring

1
2
$ yay -S mailspring
$ sudo pacman -S libsecret

TIM

1
$ yay -S deepin-wine-tim

设置 DPI(高分屏):

1
$ env WINEPREFIX="$HOME/.deepinwine/Deepin-TIM" winecfg

Graphics 中将 DPI 调整为 120

WeChat

1
$ yay -S deepin-wine-wechat

设置 DPI(高分屏):

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

Graphics 中将 DPI 调整为 120

Thunder Speed (迅雷)

1
$ yay -S deepin-wine-thunderspeed

uGet & Aria2

1
$ sudo pacman -S uget aria2

uGet -> Edit -> Settings -> Plug-in 中的设置设为 aria2 。

WPS

1
2
$ sudo pacman -S ttf-wps-fonts
$ sudo pacman -S wps-office

Redshift (Night light)

1
$ yay -S redshift

Screenshot

1
$ yay -S deepin-screenshot

开发环境

Vim

我是 Vim 党。

1
2
$ git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
$ sh ~/.vim_runtime/install_awesome_vimrc.sh

Git

在之前我们已经安装过了 Git,这里主要是一些 Git 的基本设置:

1
2
3
$ git config --global user.name "Your_username"
$ git config --global user.email "your@email.com"
$ git config --global core.editor vim  # 使用 Vim 来编辑 Git 提交信息

不要忘记添加生成并添加 GPG key 喔~

Docker

1
2
$ sudo pacman -S docker
$ sudo pacman -S docker-compose

Java

Java - ArchWiki

1
2
$ sudo pacman -S java-runtime-common java-environment-common
$ yay jdk8  # Select extra/jdk8-openjdk

使用 archlinux-java 命令来管理 Java 环境。

列举 Java 环境:

1
$ archlinux-java status

选择 Java 环境:

1
$ sudo archlinux-java set java-8-openjdk

Go

Go - ArchWiki

1
$ sudo pacman -S go go-tools

可选用 gcc-go ,但若需要使用 JetBrains 的 IDE 则必须使用 go ,否则 IDE 无法在 /usr/lib/go 下找到 Go SDK。

配置环境变量 GOPATH ,个人偏好在用户目录下的 go/ 文件夹放置 Go 相关文件。

1
2
3
4
$ vim ~/.zshrc  # OR ~/.bashrc OR ~/.profile

export GOPATH=~/go
export PATH=$PATH:$GOPATH/bin

由于某些特殊的原因,国内无法很好地拉取 Go 相关的软件包。建议使用 goproxy/goproxy.cn ,只需在拉取前输入:

1
$ export GOPROXY=https://goproxy.cn

MariaDB

MariaDB- ArchWiki

1
2
3
4
5
6
7
$ sudo pacman -S mariadb
# install MariaDB
$ sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
# start MariaDB
$ sudo systemctl start mariadb
# config MariaDB using interactive wizard
$ sudo mysql_secure_installtion

更改默认编码为 utf8mb4

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
$ sudo vim /etc/my.cnf

# append following lines
[client]
default-character-set = utf8mb4

[mysqld]
collation_server = utf8mb4_unicode_ci
character_set_server = utf8mb4

[mysql]
default-character-set = utf8mb4

重启 MariaDB 以生效。

Redis

Redis - ArchWiki

1
2
$ sudo pacman -S redis
$ sudo systemctl start redis

Visual Studio Code

Visual Studio Code - ArchWiki

宇宙第一编辑器!

可以使用 Snapd 来安装,见这里。不过笔者直接用 pacman 安装了,如下:

1
$ sudo pacman -S visual-studio-code-bin

Sublime Text

1
$ yay -S sublime-text-dev

JetBrains Toolbox

AUR - JetBrains Toolbox

JetBrains 家的 IDE 一应俱全,应有尽有!

1
2
$ yay -S jetbrains-toolbox
# $ sudo pacman -S intellij-idea-ultimate-edition

Postman

后端开发必备。

1
$ yay -S postman

KDE 插件

  • Resource Monitor

  • Netspeed Widget

  • Redshift-control

  • Active Window Control

  • Global Menu

  • Latte Dock

    1
    
    $ sudo pacman -S latte-dock
    

KDE 设置

个人喜欢的桌面设置。

Displays

屏幕 120% 放大: System Settings > Displays > Scale Display > 1.2

因为有了 Latte Dock,不再需要任务栏了,取而代之的是全局菜单。需要添加 Global Menu 的 Widget。

1
2
$ sudo pacman -S appmenu-gtk-module
$ sudo pacman -S libdbusmenu-glib  # For electron apps menu

详情见此贴

Screen Locking

System Settings > Desktop Behavior > Screen Locking > Keyboard Shortcut 设为 Meta + L

Effects

KDE 桌面动画效果。

System Settings > Workspace Behavior > Desktop Effects > Configure Desktop Effects ,设置你喜欢的桌面效果。

Window Effects

窗口切换效果:System Settings > Window Management > Task Switcher > Main > Visualization ,建议使用 Large Icons

Open Files

KDE 默认是单击打开文件,但是用习惯 Windows 及 GNOME 的我不是很习惯,遂改之:

System Settings > Desktop Behavior > Workspace > Click Behavior > Double-Click to open files and folders(single click to select) .

Shortcuts

Global Shortcuts

System Settings > Shortcuts > Global Shortcuts > KWin

ActionGlobal
Show Desktop GridMeta+Ctrl+A
Switch One Desktop DownMeta+Ctrl+Down
Switch One Desktop to the LeftMeta+Ctrl+Left
Switch One Desktop to the RightMeta+Ctrl+Right
Switch One Desktop UpMeta+Ctrl+Up
Window One Desktop DownMeta+Ctrl+Shift+Down
Window One Desktop to the LeftMeta+Ctrl+Shift+Left
Window One Desktop to the RightMeta+Ctrl+Shift+Right
Window One Desktop UpMeta+Ctrl+Shift+Up
Maximize WindowMeta+Up
Minimize WindowsMeta+Down

System Settings > Shortcuts > Global Shortcuts > Plasma

ActionGlobal
Open Klipper at Mouse PositionAlt+D

Custom Shortcuts

System Settings > Shortcuts > Custom Shortcuts > Edit

Deepin Screenshot 截屏快捷键:

  • New > Global Shortcut > Command/URL 新建全局自定义快捷键
  • TriggerCtrl + Alt + A
  • Actiondeepin-turbo-invoker --type=dtkwidget deepin-screenshot --icon

Desktop Folder Settings

Right click on Desktop > Configure Desktop... > Mouse Actions

删除 Vertical-Scroll 条目(取消滚动切换工作区)。

主题

Adapta

1
$ yay -S adapta-kde kvantum-theme-adapta adapta-gtk-theme

References


知识共享许可协议
本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可。