Manjro 折腾日记
一直很想折腾Linux,之前装过Deepin,因为当时感觉没时间折腾Linux,就放弃了,现在又重燃了我的折腾之心想要装回Deepin,可是我的电脑装新版本有问题,我就将目光转向了Manjaro,现在大概用了一个多星期,感觉还不错,就把记录的东西发出来了。
过程
安装
安装过程网上一抓一大堆,我也就不说了,参考
里面也有安装的过程和安装之后美化,我安装的是GNOME版本 (推荐使用KDE版本,折腾量少一点),在安装的时候,驱动选择的no-free
,其他的没啥备注的了。
Manjaro换源
设置官方镜像源
sudo pacman-mirrors -i -c China -m rank //更新镜像排名,选择一个速度快的
sudo pacman -Syy //更新数据源
sudo pacman -S archlinux-keyring //更新archlinux 签名
添加国内的镜像站
sudo gedit /etc/pacman.conf
在最后添加下面内容(选填一个就行)
上海交大
[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
清华大学
[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
执行下面命令,将包导入GPG key
sudo pacman -Sy archlinuxcn-keyring
sudo pacman -Syyu
系统主题
Numix[gnome]
sudo pacman -S numix-themes-archblue
Nordic
在gnome-look上找到的一款主题,使用的是Nordic-Polar
zsh相关(弃用)
安装zsh
sudo pacman -S zsh
配置oh-my-zsh
sh -ch -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
换默认shell
chsh -s /bin/zsh
#重启生效
安装高亮插件
cd ~/.oh-my-zsh/custom/plugins/
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
编辑.zshrc
gedit ~/.zshrc
找到plugins
字段,添加zsh-syntax-highlighting
,注意高亮插件必须在最后一个
plugins=(
git
zsh-syntax-highlighting
)
添加命令补全
cd ~/.oh-my-zsh/custom/plugins/
git clone https://github.com/zsh-users/zsh-autosuggestions
编辑.zshrc
gedit ~/.zshrc
找到plugins
字段,添加zsh-autosuggestions
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
载入配置
source ~/.zshrc
robbyrussell主题全路径显示
gedit ~/.oh-my-zsh/themes/robbyrussell.zsh-theme
打开后为
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗" ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
把第二行中的PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
中的%c
改为[%~]
改完之后为PROMPT='${ret_status} %{$fg[cyan]%}[%~]%{$reset_color%} $(git_prompt_info)'
载入配置后,就变成了[/home/XXX]
的样子了,如果不喜欢方括号,可以替换[%~]
中的方括号,例:%~
。
zsh更新错误
错误信息:
error: 不能变基式拉取:您有未暂存的变更。
error: 请提交或贮藏它们。
解决方法:
cd ~/.oh-my-zsh/
git add .
git commit -m "commit message"
upgrade_oh_my_zsh
fish相关 (代替zsh)
安装fish
# 安装fish
yay -S fish
安装oh-my-fish
curl -L https://get.oh-my.fish | fish
相关说明
安装robbyrussell主题
omf install robbyrussell
robbyrussell主题全路径显示
安装Amazon开源JDK Corretto
# 安装corretto
yay -S corretto-8
# 设置环境变量
export JAVA_HOME="/usr/lib/jvm/java-8-amazon-corretto/"
export PATH="$PATH:$JAVA_HOME/bin"
export CLASSPATH=".:$JAVA_HOME/lin/dt.jar:$JAVA_HOME/lib/tools.jar"
# 创建软链接
sudo ln -s /usr/lib/jvm/java-8-amazon-corretto/bin/java /usr/bin/java
安装yay
sudo pacman -S yay
gnome-terminal更换为deepin-terminal
主要是因为自带的终端不能设置透明,所以换了深度终端
yay -S deepin-terminal
Nautilus更换为deepin-file-manager
主要是因为换了深度终端
之后,右击文件夹不能显示在此打开终端
了,就连带着换成深度文件管理
了
yay -S deepin-file-manager
gnome-terminal透明化
使用 gnome-terminal-transparency
解决,深度终端不能打开链接,所以就找到了这个
yay -S gnome-terminal-transparency
如果出现prepare()错误
则先执行
yay -S base-devel
安装picgo
yay -S picgo-appimage
FireFox
火狐flashplayer插件问题
flashplugin供firefox用,pepper-flash供chromium用。
yay -S flashplugin pepper-flash
FireFox 中文菜单
yay -S firefox-i18n-zh-cn
GNOME Shell integration
给火狐添加GNOME Shell integration
插件
- Activities configurator 优化顶栏
- simple net speed 显示实时网速
- Status Area Horizontal Spacing 使顶栏更加紧凑
- TopIcons Plus 解决QQ不在系统托盘显示
解决FireFox图片有撕裂感
通过在about:config
里更改默认缩放layout.css.devPixelsPerPx=1.2
为终端设置快捷键
确认gnome-terminal的位置
type gnome-terminal
#deepin-terminal
type deepin-terminal
返回的是/usr/bin/gnome-terminal
深度终端返回的是/user/bin/deepin-terminal
在设置中设置快捷键
进入设置->设备->Keyboard
点击加号,弹出添加自定义快捷键。
名称为启动终端,在命令上填入/usr/bin/gnome-terminal
(,点击/user/bin/deepin-terminal
)Set ShortCut...
,按下想要设置的组合键即可完成。
安装mysql
#安装mysql
sudo pacman -S mysql
#初始化
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
#查看mysql状态
sudo systemctl status mysqld
#开机启动mysql服务
sudo systemctl enable mysqld
sudo systemctl start mysqld
#设置root密码
##改文件,在/root/.mysql_secret文件内
gedit /root/.mysql_secret
##直接进mysql改,默认密码是空的
sudo mysql_secure_installation
DBeaver MySql视图化管理工具
yay -S dbeaver
Robo 3T mongodb图形化管理工具
yay -S robo3t-bin
Redis Desktop Manager rides图形化管理工具
yay -S yay -S redis-desktop-managerbash
55R
使用的是electron-55r
下载好electron-55R.pacman 包
sudo pacman -U electron-55R.pacman
fcitx-rime输入法相关
安装fcitx-rime输入法
yay -S fcitx-rime
yay -S fcitx-im #全部安装
yay -S fcitx-configtool #图形化配置工具
yay -S fcitx-cloudpinyin #云输入引擎
之后更改设置
gedit ~/.xprofile #无则创建
输入以下内容
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
注销或重启生效
fcitx-rime输入法设置默认输入简体字
编辑default.yaml
文件
gedit ~/.config/fcitx/rime/build/default.yaml
找到schema_list
项
#default.yaml
schema_list:
- schema: luna_pinyin
- schema: luna_pinyin_simp
- schema: luna_pinyin_fluency
- schema: bopomofo
- schema: bopomofo_tw
- schema: cangjie5
- schema: stroke
- schema: terra_pinyin
将 - schema: luna_pinyin
和 - schema: luna_pinyin_simp
调换位置即可。
#default.yaml
schema_list:
- schema: luna_pinyin_simp
- schema: luna_pinyin
- schema: luna_pinyin_fluency
- schema: bopomofo
- schema: bopomofo_tw
- schema: cangjie5
- schema: stroke
- schema: terra_pinyin
右键点击托盘rime图标重新部署生效
Manjaro独立显卡锁帧问题
使用optirun glxgears
测试独显时,帧数锁定在60fps,在网上找到了解决办法,即Manjaro自带的bumblebee驱动需要重新安装。
# 依赖
sudo pacman -S virtualgl lib32-virtualgl lib32-primus primus
# 安装双显卡切换程序bumblebee
sudo mhwd -f -i pci video-hybrid-intel-nvidia-bumblebee
# 允许服务
sudo systemctl enable bumblebeed
# 添加用户
sudo gpasswd -a $USER bumblebee
# 重启
sudo reboot
LibreOffice 中文菜单
yay -S libreoffice-fresh-zh-cn
FireFox 中文菜单
yay -S firefox-i18n-zh-cn
更换内核
/etc/mkinitcpio.d
中有在Manjaro-setting里下载的内核的预配置文件
# 引导linux内核环境 例如 linux420.preset的预配置文件
sudo mkinitcpio -p linux420
解决安装visual studio code后,vscode变为默认的文件管理
查看当前默认的文件管理器
xdg-mime query default inode/directory
# 结果显示
visual-studio-code.desktop
修改默认文件管理器为nautilus
xdg-mime default org.gnome.Nautilus.desktop inode/directory
# 查看当前默认文件管理器
xdg-mime query default inode/directory
# 结果显示
org.gnome.Nautilus.desktop
解决更新出现"错误:无法打开文件 XXXXXX :没有那个文件或目录" 的问题
我的出现的是如下错误
:: 正在进行全面系统更新...
错误:无法打开文件 /var/lib/pacman/local/bolt-0.6-1/desc: 没有那个文件或目录
警告:lib32-systemd:本地 (239.303-1) 比 multilib 的版本更新 (239.6-2)
警告:libsystemd:本地 (239.303-1) 比 core 的版本更新 (239.6-2)
警告:systemd:本地 (239.303-1) 比 core 的版本更新 (239.6-2)
警告:systemd-sysvcompat:本地 (239.303-1) 比 core 的版本更新 (239.6-2)
正在解决依赖关系...
正在查找软件包冲突...
警告:无法完全加载软件包 bolt 的元数据 - 0.6-1
错误:无法准备事务处理 (无效或已损坏的软件包)
创建相应文件即可:
sudo touch /var/lib/pacman/local/bolt-0.6-1/desc
# 更新软件包
sudo pacman -S bolt
# 出现以下错误
正在解决依赖关系...
正在查找软件包冲突...
错误:无法打开文件 /var/lib/pacman/local/bolt-0.6-1/files: 没有那个文件或目录
警告:无法完全加载软件包 bolt 的元数据 - 0.6-1
错误:无法准备事务处理 (无效或已损坏的软件包)
# 创建相应文件
sudo touch /var/lib/pacman/local/bolt-0.6-1/files
# 更新文件包
sudo pacman -S bolt
# 出现以下错误
错误:无法提交处理 (有冲突的文件)
bolt: 文件系统中已存在 /etc/dbus-1/system.d/org.freedesktop.bolt.conf
bolt: 文件系统中已存在 /usr/bin/boltctl
bolt: 文件系统中已存在 /usr/lib/boltd
发生错误,没有软件包被更新。
# 删除相应的文件
sudo rm /etc/dbus-1/system.d/org.freedesktop.bolt.conf
sudo rm /usr/bin/boltctl
sudo rm /usr/lib/boltd
# 更新软件包
sudo pacman -S bolt
添加触摸板开关快捷键
安装libinput
xf86-input-libinput
xorg-xinput
yay -S libinput xf86-input-libinput xorg-xinput
在/usr/bin/
创建touchpad_toggle
sudo touch /usr/bin/touchpad_toggle
将代码粘贴到touchpad_toggle
中
#!/bin/bash
declare -i ID
ID=`xinput list | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
declare -i STATE
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
if [ $STATE -eq 1 ]
then
xinput disable $ID
# echo "Touchpad disabled."
# notify-send 'Touchpad' 'Disabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png
else
xinput enable $ID
# echo "Touchpad enabled."
# notify-send 'Touchpad' 'Enabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png
fi
设置权限
sudo chmod a+x /usr/bin/touchpad_toggle
设置快捷键
我设置的快捷键是supper
+T
状态栏显示实时网速cpu内存等信息
#安装显示网速的软件
yay -S indicator-sysmonitor
#安装依赖AppIndicator3和psutil
yay -S libappindicator-gtk3
yay -S python2-psutil
#输入以下命令,回车并关闭终端
nohup indicator-sysmonitor
右键点击系统托盘中的该插件图标,选择Preferences进入,在General
中勾选开机启动
选项,在Advanced
的Customize output
里添加{net}
显示网速。
迅雷
yay -S deepin.com.thunderspeed
添加kcptun客户端自动启动
在~/.config/autostart
中新建一个Desktop文件,例kcptun.desktop
,添加下列内容
[Desktop Entry]
Name=kcptun
Exec=/home/morey/.kcptun/client_linux_amd64 -c /home/morey/.kcptun/kcptun_config.json
Terminal=false
Type=Application
StartupNotify=false
开机挂载交换分区
查看分区情况
sudo blkid -o list
打开配置文件,将UUID=xxxxxxx swap swap defaults,noatime 0 0
添加到/etc/fstab
下,用查询出来的swap分区的UUID代替xxxxxxx
sudo gedit /etc/fstab
参考
- Manjaro安装以及美化教程
- iTerm2 + Oh My Zsh 打造舒适终端体验
- oh-my-zsh修改默认robbyrussel主题添加全路径显示
- Manjaro 安装后的配置
- flashplayer插件问题
- archlinux/manjaro-gnome-terminal背景透明
- 萌新求教 gnome-terminal-transparency. 安装的时候出错
- 求教,manjaro的bumblebee 独显输出为什么这么小?
- oh my zsh无法更新
- Manjaro Gnome版设置默认文件管理器(inode/directory)为Nautilus
- 更新与安装软件的问题
- manjaro 禁用触摸板
- manjaro 状态栏显示实时网速cpu内存等信息
- 再打个包:arch/manjaro-deepin能用迅雷了!
- 新建swap分区的规划、挂载和自动挂载示例