Manjaro gnome 版系统配置

3017

Manjaro介绍

Manjaro的版本

官方推荐的:

  • XFCE:非常轻量,适合硬件条件比较差的用户,占用资源较少
  • KDE:操作界面类似Windows的操作界面
  • ARCHITECH:命令行版本,类似Arch Linux,后期要装什么都自己解决,适合Geek
  • GNOME(GNOME3):操作界面类似 Mac OS

社区维护的版本:

  • MATE:GNOME2的延续,用不惯GNOME3的可以选择使用
  • CINNAMON:Mint Linux使用的界面,使用了GNOME3的技术,实现了GNOME2的界面
  • OPENBOX:同样一个轻量级的桌面,没有使用过,具体不太了解。
  • AWESOME:高度可定制化的一个桌面系统,适合Geek
  • BSPWM:轻量平铺窗口的桌面,没用过。
  • BUDGIE:看界面像是基于GNOME2
  • I3:高度可配置的平铺化界面
  • DEEPIN:国内团队开发,界面介于Windows和Mac OS之间。UI看起来不错

配置

Pacman mirror refresh

更换为中国镜像源

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

添加 ArchLinuxCN 的软件源,编辑pacman.conf文件

$ sudo vim /etc/pacman.conf

在末尾添加

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

导入 archlinuxcn-keyring

$ sudo pacman -S archlinuxcn-keyring

最后刷新一下缓存:

$ sudo pacman -Syyu

Yay package manager

sudo pacman -S yay
# change AUR source
yay --aururl "https://aur.tuna.tsinghua.edu.cn" --save

Base-devel

sudo pacman -S base-devel

Basic utilities

sudo pacman -S htop tree glances nload ncdu vim

oh-my-zsh

$ sudo pacman -S zsh

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

安装插件

# 安装
yay -S autojump

#修改配置,在plugin中添加autojump
sudo vim .zshrc

# 让配置生效
source ~/.zshrc

在plugins中加上autojump

plugins=(其他插件 autojump)

语法高亮插件

# 安装
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

在配置(~/.zshrc`)中设置

plugins=(其他插件 zsh-syntax-highlighting)

同样生效需要source,如上

zsh-autosuggestions(命令自动补全)

如果感觉 → 补全不方便,还可以自定义补全的快捷键,比如我设置的逗号补全,只需要在 .zshrc 文件添加这句话即可

bindkey ',' autosuggest-accept

官网中有多种安装方式,这里选择oh my zsh中的安装方式:

安装

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

配置

plugins=(其他插件 zsh-autosuggestions)

当你重新打开终端的时候可能看不到变化,可能你的字体颜色太淡了,我们把其改亮一些:

cd ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
vim zsh-autosuggestions.zsh
# 修改 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10
# source ~/.zshrc 更新配置

Input Method

搜狗拼音

sudo pacman -S fcitx-im #默认全部安装

sudo pacman -S fcitx-gtk2 fcitx-gtk3

sudo pacman -S fcitx-qt4 fcitx-qt5

sudo pacman -S fcitx-configtool

sudo pacman -S fcitx-sogoupinyin

配置

sudo vim ~/.xprofile

加入以下内容

export GTK_IM_MODULE=fcitx

export QT_IM_MODULE=fcitx

export XMODIFIERS="@im=fcitx"

或者使用Libpinyin

sudo pacman -S fcitx fcitx-libpinyin kcm-fcitx

配置Libpinyin

sudo vim ~/.xprofile

# 加入以下内容
export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
export LC_CTYPE=zh_CN.UTF-8
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx

重启生效

Environment

Java

Install jdk8, jdk8 source code and documentation.

sudo pacman -S jdk8-openjdk openjdk8-doc openjdk8-src

Node

Install nodejs 、npm、cnpm、vue

sudo pacman -S nodejs npm
sudo npm install -g cnpm
sudo cnpm install -g @vue/cli

MySQL

安装mariadb

sudo pacman -S mariadb
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo systemctl start mariadb
sudo /usr/bin/mysql_secure_installation
sudo systemctl enable mariadb
mysql -u root -p

或者安装mysql

# 安装mysql
☁ ~  sudo pacman -S mysql
[sudo] guqing 的密码:
正在解析依赖关系...
正在查找软件包冲突...

软件包 (1) mysql-8.0.17-2

全部安装大小:  181.99 MiB

:: 进行安装吗? [Y/n] y
(1/1) 正在检查密钥环里的密钥                       [######################] 100%
(1/1) 正在检查软件包完整性                         [######################] 100%
(1/1) 正在加载软件包文件                           [######################] 100%
(1/1) 正在检查文件冲突                             [######################] 100%
(1/1) 正在检查可用存储空间                         [######################] 100%
:: 正在处理软件包的变化...
(1/1) 正在安装 mysql                               [######################] 100%
:: You need to initialize the MySQL data directory prior to starting
   the service. This can be done with mysqld --initialize command, e.g.:
   mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql
:: Additionally you should secure your MySQL installation using
   mysql_secure_installation command after starting the mysqld service
mysql 的可选依赖
    perl-dbd-mysql: for mysqlhotcopy, mysql_convert_table_format and
    mysql_setpermission
:: 正在运行事务后钩子函数...
(1/3) Reloading system manager configuration...
(2/3) Creating temporary files...
(3/3) Arming ConditionNeedsUpdate...
☁  ~  sudo mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql
2019-10-28T11:12:36.288934Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2019-10-28T11:12:36.288985Z 0 [System] [MY-013169] [Server] /usr/bin/mysqld (mysqld 8.0.17) initializing of server in progress as process 13043
2019-10-28T11:12:36.290594Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2019-10-28T11:12:36.290601Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2019-10-28T11:12:36.290646Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-10-28T11:12:36.291615Z 0 [System] [MY-010910] [Server] /usr/bin/mysqld: Shutdown complete (mysqld 8.0.17)  Source distribution.

# 我这里报了了一个错删除这个目录即可,不一定每个人都会有这样的错误
☁  ~  sudo rm -rf /var/lib/mysql/

# 初始化mysql,这样会得到一个root账户和密码用于修改密码时使用
☁  ~  sudo mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql
2019-10-28T11:13:31.326305Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2019-10-28T11:13:31.326364Z 0 [System] [MY-013169] [Server] /usr/bin/mysqld (mysqld 8.0.17) initializing of server in progress as process 13088
2019-10-28T11:14:57.368794Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 0t?Bqc88sowf
2019-10-28T11:15:59.954104Z 0 [System] [MY-013170] [Server] /usr/bin/mysqld (mysqld 8.0.17) initializing of server has completed

# 启动mysql服务
☁  ~  sudo systemctl start mysqld.service

# 执行这一步可以免手动修改很多内容比如修改密码,删除测试用户等
☁  ~  mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root: 

The existing password for the user account root has expired. Please set a new password.

New password: 

Re-enter new password: 

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: n
Using existing password for root.
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password: 

Re-enter new password: 
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n

 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done!
# 设置mysql服务开机启动
☁  ~  sudo systemctl enable mysqld        
[sudo] guqing 的密码:
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /usr/lib/systemd/system/mysqld.service

docker安装mysql

docker run -d -p 3306:3306 --name mysql -v /opt/mysql/datadir:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 mysql --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci

大功告成!!

有道词典

sudo yay -S youdao-dict

Postgresql

docker安装postgresqlpostgis

# 启动
$ docker run -d --name postgres96 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=123456 -v /usr/local/postgis/data:/var/lib/postgresql/data kartoza/postgis:9.6-2.4

pgAdmin客户端

使用docker安装postgresql图形化的客户端

$ sudo docker run -p 5050:80 \
    -e 'PGADMIN_DEFAULT_EMAIL=1484563614@qq.com' \
    -e 'PGADMIN_DEFAULT_PASSWORD=123456' \
    -e 'PGADMIN_CONFIG_ENHANCED_COOKIE_PROTECTION=True' \
    -e 'PGADMIN_CONFIG_CONSOLE_LOG_LEVEL=10' \
    -d dpage/pgadmin4

启动postgresql服务后,打开浏览器输入localhost:5050就可以看到客户端登录页了,输入邮箱地址和密码登录,在使用本机ip地址链接postgresql即可,使用localhost好像不能连接上

IDE

VisualStudioCode

yay -S visual-studio-code-bin

CodeBlocks

sudo pacman -S codeblocks

Entertainment

Netease cloud music

yay -S netease-cloud-music

Browser

sudo pacman -S google-chrome

Download Tools

# aria2
sudo pacman -S aria2
# baidunetdisk
sudo pacman -S baidunetdisk-bin

时钟不同步

设置使用本地时间

$ sudo timedatectl set-local-rtc tr

安装openNTPD

$ sudo pacman -S openntpd

启动服务:

$ systemctl restart openntpd

设置开机启动

$ systemctl enable openntpd

gnome打开终端快捷键

打开设置
找到设备
点击键盘和快捷键
滑到最底部点击+号
然后输入快捷键的名称比如:打开终端
输入操作:gnome-terminal
绑定一组快捷键如:Alt + Q

设置终端terminal透明

安装这东西的前提是必须先安装base-devel

sudo pacman -S base-devel

然后在安装透明终端

yay -S gnome-terminal-transparency

然后就有设置终端透明度的选项了

美化

系统主题:

解压主题后复制到/usr/share/themes即可

# mcMojave主题
https://www.gnome-look.org/p/1275087/

# flat-remix-gnome
https://github.com/daniruiz/flat-remix-gnome

# Canta theme
https://www.gnome-look.org/p/1220749/

系统图标

解压图标后复制到路径/usr/share/icons即可

安装: la-capitaine-icon-theme

# 安装la-capitaine-icon-theme可以使用yay安装
yay -S la-capitaine-icon-theme

套装:Canta-theme

# 包括主题,图标和shell
https://github.com/vinceliuice/Canta-theme

其他图标主题推荐:

McMojave-circle

Tela-icon-theme

XONE ICONS PACK

XONE II ICON PACK

XONE Catalina

ketsa icons