4

将干净的 Manjaro 快速配置为工作环境

 2 years ago
source link: https://blog.triplez.cn/posts/manjaro-quick-start/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Manjaro 宇宙第一!

初始化配置#

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

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

添加国内软件源#

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

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

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

安装密钥:

$ sudo pacman -Syu archlinuxcn-keyring

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

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

更新系统#

$ sudo pacman -Syyu

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

$ sudo timedatectl set-local-rtc true

必备工具#

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

yay 是 AUR 管理工具。

双显卡切换#

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

Emoji Support#

$ sudo pacman -S noto-fonts-emoji

科学上网#

这是最最最基础的需求!

Shadowsocks#

$ sudo pacman -S shadowsocks-qt5

可以设为开机启动。

ShadowsocksR#

electron-ssr (AUR)

$ yay -S electron-ssr

Privoxy#

将 Socks5 转为 HTTP 代理。

$ sudo pacman -S privoxy

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

编辑配置 /etc/privoxy/config

# 把本地 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#

$ sudo pacman -S proxychains-ng

日常软件#

搜狗输入法#

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

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

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

安装必备字体:

$ 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 来作为中文输入法。

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

Telegram#

$ sudo pacman -S telegram-desktop

Dropbox#

$ yay -S dropbox

坚果云#

$ sudo pacman -S nutstore

Typora#

$ sudo pacman -S typora

oh-my-zsh#

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

安装插件:

$ 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#

$ sudo pacman -S google-chrome

网易云音乐#

$ sudo pacman -S netease-cloud-music

MailSpring#

$ yay -S mailspring
$ sudo pacman -S libsecret

TIM#

$ yay -S deepin-wine-tim

设置 DPI(高分屏):

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

Graphics 中将 DPI 调整为 120

WeChat#

$ yay -S deepin-wine-wechat

设置 DPI(高分屏):

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

Graphics 中将 DPI 调整为 120

Thunder Speed (迅雷)#

$ yay -S deepin-wine-thunderspeed

uGet & Aria2#

$ sudo pacman -S uget aria2

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

WPS#

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

Redshift (Night light)#

$ yay -S redshift

Screenshot#

$ yay -S deepin-screenshot

开发环境#

Vim#

我是 Vim 党。

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

Git#

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

$ git config --global user.name "Your_username"
$ git config --global user.email "[email protected]"
$ git config --global core.editor vim  # 使用 Vim 来编辑 Git 提交信息

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

Docker#

$ sudo pacman -S docker
$ sudo pacman -S docker-compose

Java#

Java - ArchWiki

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

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

列举 Java 环境:

$ archlinux-java status

选择 Java 环境:

$ sudo archlinux-java set java-8-openjdk

Go#

Go - ArchWiki

$ sudo pacman -S go go-tools

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

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

$ vim ~/.zshrc  # OR ~/.bashrc OR ~/.profile

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

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

$ export GOPROXY=https://goproxy.cn

MariaDB#

MariaDB- ArchWiki

$ 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

$ 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

$ sudo pacman -S redis
$ sudo systemctl start redis

Visual Studio Code#

Visual Studio Code - ArchWiki

宇宙第一编辑器!

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

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

Sublime Text#

$ yay -S sublime-text-dev

JetBrains Toolbox#

AUR - JetBrains Toolbox

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

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

Postman#

后端开发必备。

$ yay -S postman

KDE 插件#

  • Resource Monitor

  • Netspeed Widget

  • Redshift-control

  • Active Window Control

  • Global Menu

  • Latte Dock

    $ sudo pacman -S latte-dock
    

KDE 设置#

个人喜欢的桌面设置。

Displays#

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

Global Menu#

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

$ 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

Action Global

Show Desktop Grid Meta+Ctrl+A

Switch One Desktop Down Meta+Ctrl+Down

Switch One Desktop to the Left Meta+Ctrl+Left

Switch One Desktop to the Right Meta+Ctrl+Right

Switch One Desktop Up Meta+Ctrl+Up

Window One Desktop Down Meta+Ctrl+Shift+Down

Window One Desktop to the Left Meta+Ctrl+Shift+Left

Window One Desktop to the Right Meta+Ctrl+Shift+Right

Window One Desktop Up Meta+Ctrl+Shift+Up

Maximize Window Meta+Up

Minimize Windows Meta+Down

System Settings > Shortcuts > Global Shortcuts > Plasma

Action Global

Open Klipper at Mouse Position Alt+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#

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

References#


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

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK