manjaro安装后需要做的事情

注意

安装系统时选:上海,系统、编码 两个都选 zh-CN.UTF-8 免得后面系统全是英文

快捷

1
2
3
4
mkdir -p ~/li && git clone https://gitee.com/humble-zh/zhbox-blog.git ~/li/.zbb;
bash -x ~/li/.zbb/source/_posts/TODO_after_manjaro_installed/manjaro_config.sh
bash -x ~/li/.zbb/source/_posts/TODO_after_manjaro_installed/manjaro_config.sh vim
bash -x ~/li/.zbb/source/_posts/TODO_after_manjaro_installed/manjaro_config.sh ohmyzsh

改为国内源

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

更新

1
sudo pacman -Syyu

添加源

在 /etc/pacman.conf 追加

1
2
3
[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = http://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
1
2
sudo pacman -Syyu
sudo pacman -S archlinuxcn-keyring

更换中文字体(simsun.ttc或MSYH.TTF)

1
2
3
4
5
6
7
sudo pacman -S wqy-microhei
cd $(当前仓库)
sudo cp -r ./source/_posts/TODO_after_manjaro_installed/fonts/zhfonts /usr/share/fonts
cd /usr/share/fonts/zhfonts
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -fv

修改i3配置

1
2
3
cd $(当前仓库)
mv ~/.i3/config ~/.i3/config.bak
ln -s $(pwd)/source/_posts/TODO_after_manjaro_installed/i3/config ~/.i3/config

Linux交换Esc和Caps

在文件 ~/.i3/config 加入

1
exec_always --no-startup-id setxkbmap -option caps:swapescape &

修改默认浏览器为firefox(也可选chromium)

  1. 安装firefox

    1
    sudo pacman -S firefox-i18n-zh-cn
  2. 修改~/.i3/config对应行

    1
    bindsym $mod+F2 exec firefox
  3. 修改系统默认打开方式文件:~/.config/mimeapps.list

    1
    2
    vim ~/.config/mimeapps.list
    :%s/userapp-Pale Moon/firefox/g
  4. 修改~/.profile

    1
    export BROWSER=/usr/bin/firefox
  5. 卸载palemoon

    1
    sudo pacman -Rns local/palemoon-bin
  6. 重新加载配置或重启

  7. 安装插件

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    Tampermonkey(有些脚本在Greasemonkey无法运行)
    AC-baidu:重定向优化百度搜狗谷歌必应搜索_favicon_双列
    【玩的嗨】VIP工具箱,全网VIP视频免费破解去广告,一站式音乐搜索下载,获取B站封面,下载B站视频,上学吧答案获取等众多功能聚合
    百度网盘直链满速下载助手
    网盘自动填写访问码【威力加强版】
    豆瓣资源下载大师:1秒搞定豆瓣电影|音乐|图书下载
    持续更新 CSDN广告完全过滤、人性化脚本优化:不用再登录了!让你体验令人惊喜的崭新CSDN
    购物党实时比价工具(浏览器57以上版本安装)
    Adblock Plus - 免费的广告拦截器
    Vedio Speed Controller
    Vimium C 全键盘操作浏览器
    划词翻译 有道
    京价保 - 京东价保助手
    Video Downloader Pro 免费视频下载器
    网页截图
    Gesturefy 鼠标手势操作
    markdown-clipper 网页保存为markdown

    关闭桌面左下脚提示

注释掉/usr/bin/start_conky_maia里的# conky -c /usr/share/conky/conky1.10_shortcuts_maia &&

安装中文输入法(sunpinyin或libpinyin)

  1. 安装输入法以及依赖
    1
    sudo pacman -S fcitx fcitx-im fcitx-configtool fcitx-ui-light ttf-dejavu adobe-source-han-sans-otc-fonts fcitx-libpinyin fcitx-sunpinyin fcitx-cloudpinyin
  2. 给文件 ~/.xprofile 追加
    1
    2
    3
    export GTK_IM_MODULE=fcitx
    export QT_IM_MODULE=fcitx
    export XMODIFIERS="@im=fcitx"
  3. 给文件 ~/.profile 追加
    1
    fcitx

    安装配置vim/neovim

在 ~/.profile 修改默认编辑器为vim

1
export EDITOR=/usr/bin/vim

如何解决 Windows 和 Manjaro 双系统时间不一致_差8小时的问题

1
2
3
sudo pacman -S ntp
#sudo timedatectl set-ntp true
sudo timedatectl set-local-rtc true

解决桌面右上角的日期显示方块乱码

1
2
3
sudo cp /usr/share/conky/conky_maia /usr/share/conky/conky_maia.bak
sudo vim /usr/share/conky/conky_maia
:%s/Bitstream Vera/anti/g

删除状态栏的”no battery”

1
2
cd $(当前仓库)
ln -s $(pwd)/source/_posts/TODO_after_manjaro_installed/i3status.conf ~/.i3status.conf

拷贝 /etc/i3status.conf 到 ~/.i3status.conf ,注释 ~/.i3status.conf 以下行

1
order += "battery all"

~/.i3status.conf 修改状态栏的时间日期格式

1
2
3
4
tztime local {
format = "%Y-%m-%d %H:%M:%S"
# format = " %d.%m. %H:%M "
}

安装常用软件

scrot: 截图软件

inkscape: 编辑图片画框画箭头等等

variety: 更换壁纸

the_silver_searcher: 快速的代码命令行搜索工具 ag

autojump: 快速跳转目录

fzf: 终端命令行模糊查询历史

cloc: 统计代码行数,可区分文件类型以及空行和注释

zeal: 离线文档浏览器

albert: 快捷搜索/执行

1
2
3
4
5
6
sudo pacman -S sshpass mosquitto scrot inkscape the_silver_searcher fzf base-devel cmake unrar unzip yay netcat cloc smplayer you-get albert

#echo '. /usr/share/autojump/autojump.bash' >> ~/.bashrc
#echo '. /usr/share/fzf/key-bindings.bash' >> ~/.bashrc
#echo '. /usr/share/fzf/completion.bash' >> ~/.bashrc
#source ~/.bashrc

删除不必要的软件

1
sudo pacman -Rns $(pacman -Qdtq)

安装ohmyzsh

1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

1
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

1
2
curl -Lo install.sh https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh

如果出现 Failed to connect to raw.githubusercontent.com port 443: Connection refused ,就在/etc/hosts文件追加

1
199.232.28.133 raw.githubusercontent.com

修改ohmyzsh配置

1
2
3
cd $(当前仓库)
mv ~/.zshrc ~/.zshrc.bak
ln -s $(pwd)/source/_posts/TODO_after_manjaro_installed/zshrc ~/.zshrc

安装ohmyzsh两个插件zsh-syntax-highlightingzsh-autosuggestions

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

查看git命令缩写

1
cat ~/.oh-my-zsh/plugins/git/git.plugin.zsh

git status中文乱码

1
git config --global core.quotepath false

系统无声音

测试声音 speaker-test

小新pro14,因为是新电脑,声卡很新。使用aplay -l 命令 ,显示没有声卡就安装sudo pacman -S sof-firmware

Manjaro 没有声音(伪输出)怎么办

可能就是你关机的时候是强制关机的,导致管理声音的软件异常退出,下次开机的时候管理声音的软件没有打开造成的,下面有5个方法,每种电脑可能都不一样,我尝试了多种方法,今天就来记录一下。每种方法使用完必须要重启一下电脑才可以的
方法1

1
amixer -D pulse sset Master toggle

方法2

1
2
rm -R .config/pulse/
sudo pacman -S pulseaudio

方法3

1
2
sudo gpasswd -a $USER audio
sudo killall pulseaudio

方法4

1
2
3
pulseaudio --check
pulseaudio --kill
pulseaudio --start

方法5

1
2
systemctl --user restart pulseaudio.service
systemctl --user restart pulseaudio.socket

参考文献

https://askubuntu.com/questions/15223/how-can-i-restart-pulseaudio-without-having-to-logout
https://unix.stackexchange.com/questions/204522/how-does-pulseaudio-start
https://forum.manjaro.org/t/solved-manjaro-xfce-no-sound-dummy-output/26332

Manjaro设置声音

  1. 试试系统中有没有alsamixer命令,直接终端执行alsamixer(没有的话请安装alsa-utils)
  2. 在终端执行 aplay -l 查看声卡信息
  3. 执行: amixer scontrols
  4. 然后: amixer -c 1 scontrols
  5. 给(新建)文件 ~/.asoundrc 追加下面内容
    1
    2
    3
    defaults.pcm.card 1
    defaults.pcm.device 0
    defaults.ctl.card 1
  6. $mod+Shift+r

win10更新后无法引导manjaro

情况一

先入winPE,使用扇区小工具BOOTICEUEFI - 修改启动序列 - WindowsBootManager - 启动分区 改为linux的swap(8G)重启就可以进grub引导进linux,执行sudo update-grub

再进winPE,使用扇区小工具BOOTICEUEFI - 修改启动序列 - WindowsBootManager - 启动文件,见到从\EFI\Microsoft\Boot\bootmgfw.efi改为了\EFI\Manjaro\grubx64.efi就行(或者见到WindowsBootManager的是\EFI\Microsoft\Boot\bootmgfw.efiManjaro的是\EFI\Manjaro\grubx64.efi)

情况二

1
2
3
error: unknown filesystem.
Entering rescue mode...
grub rescue> _

Manjaro won’t boot after Windows Update

1
2
3
4
5
6
ls #输出(hd0) (hd0,gpt6) (hd0,gpt5) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)
ls (hd0,6)/boot #输出了目录内容
set root=(hd0,6)
set prefix=(hd0,6)/boot/grub
insmod normal
normal #就可以进入系统然后按照下面的进行修复

GRUB/Restore the GRUB Bootloader

1
2
3
4
sudo pacman -Syu grub
sudo update-grub
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck
sudo grub-mkconfig -o /boot/grub/grub.cfg

选装

修改字体DPI

i3wm 调节分辨率,鼠标大小等等

1
2
3
4
5
6
cp ~/.Xresources ~/.Xresources.bak
# 修改 Xft.dpi: 96 为 Xft.dpi: 144
# sudo xrdb ~/.Xresources # 使配置文件生效
# 修改 URxvt.font: 9x15,xft:TerminessTTFNerdFontMono
# 成为 URxvt.font: xft:TerminessTTFNerdFontMono:size=15
reboot

修改触摸板上下滚动

1
sudo cp /etc/X11/xorg.conf.d/30-touchpad.conf /etc/X11/xorg.conf.d/30-touchpad.conf.bak
1
2
3
4
5
6
7
8
9
--- /etc/X11/xorg.conf.d/30-touchpad.conf.bak	2021-01-24 22:23:49.541749394 +0800
+++ /etc/X11/xorg.conf.d/30-touchpad.conf 2021-01-24 22:21:09.836616261 +0800
@@ -3,4 +3,6 @@
Driver "libinput"
MatchIsTouchpad "on"
Option "Tapping" "on"
+ Option "NaturalScrolling" "true"
+ Option "ClickMethod" "clickfinger" #(去掉,因为右键会失效)
EndSection

联想小新pro14触摸板和键盘失灵

不能进系统:进入grub界面,按e编辑,在linux行的quiet splash后面加入i8042.dumbkdb nomodeset,按F10进入系统

能进系统:给/etc/default/grubGRUB_CMDLINE_LINUX_DEFAULT行的quiet splash后面加i8042.dumbkdb nomodeset,然后sudo update-grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.direct i8042.dumbkbd"

若esc和cpas没有切换,则在.i3/config新增3行

1
2
3
exec_always --no-startup-id xmodmap -e "clear lock"
exec_always --no-startup-id xmodmap -e "keycode 9 = Caps_Lock NoSymbol Caps_Lock"
exec_always --no-startup-id xmodmap -e "keycode 66 = Escape NoSymbol Escape"

开启ssh服务

1
2
3
sudo systemctl enable sshd.service #开机启动
sudo systemctl start sshd.service #立即启动
sudo systemctl restart sshd.service #立即重启

避免进不了桌面

1
sudo pacman -S xf86-video-amdgpu

安装录屏工具

1
sudo pacman -S obs-studio

安装VSCode

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

VSCode安装vim插件后,esc和caps没切换,在设置里搜Keyboard:Dispatch改为keyCode重启软件即可

win的ntfs分区只读

在win打开Windows Powershell(管理员)用下面命令关闭快速启动

1
powercfg /h off

安装mqtt.fx

1
yay -S mqttfx-bin

配置mail

1
sudo pacman -S mailx

修改 /etc/mail.rc 权限并追加内容

1
2
3
set from=humble.li@evpowergroup.com smtp="smtp.mxhichina.com"
set smtp-auth-user="humble.li@evpowergroup.com" smtp-auth-password="123456"
set smtp-auth=login

WPS-Office

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

typora-free-0.11.18-1

1
yay -S typora-free

openwrt编译依赖软件

1
2
3
4
sudo pacman -S --needed bash bc bin86 binutils bzip2 cdrkit core/which \
diffutils fastjar findutils flex gawk gcc gettext git intltool \
libusb libxslt make ncurses openssl patch perl-extutils-makemaker \
pkgconf python3 rsync sharutils time unzip util-linux wget zlib

ss-libev&v2ray-plugin

1
2
3
sudo pacman -S shadowsocks-libev shadowsocks-v2ray-plugin proxychains
v2ray-plugin --help
nohup ss-local -c ~/v2ray.conf &

/etc/proxychains.confsocks4*改为socks5 127.0.0.1 1080

浏览器:手动代理配置:127.0.0.1,端口:1080,使用SOCKSv5时代理DNS查询

yay无法proxychains

注释/etc/proxychains.confproxy_dns

安装todesk

1
2
3
4
5
6
yay -S todesk
sudo systemctl start todeskd.service
sudo systemctl is-enabled todeskd.service
sudo systemctl enabled todeskd.service
# 如果开机没有自启动就
# sudo chmod 744 ~/.config/autostart/todesk.desktop

安装向日葵

1
yay -S sunloginclient

每次开机都需要运行一次下面指令才能正常使用向日葵

1
systemctl start runsunloginclient.service

解决Manjaro i3社区版 compton默认配置不正确的问题

2020年1月10日 更新。默认配置可以使用透明,需要取消 compton.conf 中

1
2
3
#inactive-opacity = 0.93;
#active-opacity = 1;
#取消这两行的注释

此问题默认存在于manjaro-i3-18.1.5-191229-linux54之前的版本中。 i3 社区版中compton包名已经改名为picom。 终端中运行:

1
2
pkill comton #关闭compton
compton -b #运行compton

错误显示为:

1
2
3
4
5
6
[ 01/09/2020 18:38:49.762 parse_config_libconfig WARN ] Option `no-dock-shadow` is deprecated, and will be removed. Please use the wintype option `shadow` of `dock` instead.
[ 01/09/2020 18:38:49.762 parse_config_libconfig WARN ] Option `menu-opacity` is deprecated, and will be removed.Please use the wintype option `opacity` of `popup_menu` and `dropdown_menu` instead.
[ 01/09/2020 18:38:49.762 parse_config_libconfig WARN ] vsync option will take a boolean from now on. "none" is interpreted as "false" for compatibility, but this will stop working soon
[ 01/09/2020 18:38:49.763 parse_config_libconfig WARN ] glx-swap-method has been deprecated since v6, your setting "undefined" should be removed.
[ 01/09/2020 18:38:49.763 parse_config_libconfig WARN ] "clear-shadow" is removed as an option, and is always enabled now. Consider removing it from your config file
[ 01/09/2020 18:38:49.763 parse_config_libconfig WARN ] "paint-on-overlay" has been removed as an option, and is enabled whenever possible
1
2
3
4
5
6
cd $(当前仓库)
sed -i 's/compton/picom/g' ~/.i3/config #将.i3/config中的compton 替换为picom
mv ~/.config/compton.conf ~/.config/compton.conf.old #删除原有.config/compton.conf
vim ~/.config/picom.conf #新建picom.conf文件,输入内容
cp ${pwd}/source/_posts/TODO_after_manjaro_installed/picom.conf ~/.config/picom.conf
reboot #重启系统
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# ~/.config/picom.conf
# Shadow
shadow = true;
# no-dnd-shadow = true;
#no-dock-shadow = true;
#clear-shadow = true;
detect-rounded-corners = true;
shadow-radius = 5;
shadow-offset-x = 1;
shadow-offset-y = 1;
shadow-opacity = .3;
shadow-ignore-shaped = false;
shadow-exclude = [
"name = 'Notification'",
# workaround for conky until it provides window properties:
"override_redirect = 1 && !WM_CLASS@:s",
"class_g ?= 'Dmenu'",
# "class_g ?= 'Dunst'",
# disable shadows for hidden windows:
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
"_GTK_FRAME_EXTENTS@:c",
# disables shadows on sticky windows:
# "_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'",
# disables shadows on i3 frames
"class_g ?= 'i3-frame'"
];

# shadow-exclude-reg = "x10+0+0";
# xinerama-shadow-crop = true;

#menu-opacity = 0.95;
#inactive-opacity = 0.93;
#active-opacity = 1;
#alpha-step = 0.01;
#inactive-dim = 0.0;
#blur-background = false;
#blur-kern = "3x3box";

fading = false;
fade-delta = 1;
fade-in-step = 0.03;
fade-out-step = 0.03;
fade-exclude = [ ];

backend = "xrender";
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-client-opacity = true;
unredir-if-possible = true;
refresh-rate = 0;
vsync = false;
dbe = false;
#paint-on-overlay = true;
focus-exclude = [ "class_g = 'Cairo-clock'" ];
detect-transient = true;
detect-client-leader = true;
invert-color-include = [ ];
glx-copy-from-front = false;
#glx-swap-method = "undefined";

#opacity-rule = [
#"99:name *?= 'Call'",
#"99:class_g = 'Chromium'",
#"99:name *?= 'Conky'",
#"99:class_g = 'Darktable'",
#"50:class_g = 'Dmenu'",
#"99:name *?= 'Event'",
#"99:class_g = 'Firefox'",
#"99:class_g = 'GIMP'",
#"99:name *?= 'Image'",
#"99:class_g = 'Lazpaint'",
#"99:class_g = 'Midori'",
#"99:name *?= 'Minitube'",
#"99:class_g = 'Mousepad'",
#"99:name *?= 'MuseScore'",
#"90:name *?= 'Page Info'",
#"99:name *?= 'Pale Moon'",
#"90:name *?= 'Panel'",
#"99:class_g = 'Pinta'",
#"90:name *?= 'Restart'",
#"99:name *?= 'sudo'",
#"99:name *?= 'Screenshot'",
#"99:class_g = 'Viewnior'",
#"99:class_g = 'VirtualBox'",
#"99:name *?= 'VLC'",
#"99:name *?= 'Write'",
#"93:class_g = 'URxvt' && !_NET_WM_STATE@:32a",
#"0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
#"96:_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'"
#];

wintypes :
{
tooltip :
{
fade = true;
shadow = false;
opacity = 0.85;
focus = true;
};
fullscreen :
{
fade = true;
shadow = false;
opacity = 1;
focus = true;
};
};

````

### [安装vnc](http://blog.lujun9972.win/blog/2018/09/20/%E5%9C%A8archlinux%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AEvnc-server/index.html)

```bash
sudo pacman -S tigervnc
vncpasswd
#Would you like to enter a view-only password (y/n)? n
sudo cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@\:1.service
sudo vim /etc/systemd/system/vncserver@:1.service
sudo systemctl daemon-reload
sudo systemctl start vncserver@:1.service
sudo systemctl enable vncserver@:1.service
ls ~/.vnc
vncserver :1
netstat -pantu|grep 5901
# 客户端开始连接 vncviewer 192.168.1.3:5901
1
2
3
4
5
6
7
8
9
10
11
12
13
# /etc/systemd/system/vncserver@:1.service
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=simple
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver_wrapper zh %i
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target

deepin TIM/QQ

前提:添加 archlinuxcn 源。在 /etc/pacman.conf 里加入以下代码:

1
2
3
[archlinuxcn]
SigLevel = Never
Server = http://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
1
sudo pacman -Sy

安装 TIM

1
2
sudo pacman -S deepin.com.qq.office
nohup /opt/deepinwine/apps/Deepin-WeChat/run.sh > /dev/null 2>&1 &

无法启动

1
2
3
4
5
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 20 (X_GetProperty)
Resource id in failed request:
0x0 Serial number of failed request:
10 Current serial number in output stream: 10

解决方案

1
2
3
yaourt -S gnome-settings-daemon
nohup /usr/lib/gsd-xsettings > /dev/null 2>&1 &
nohup /opt/deepinwine/apps/Deepin-WeChat/run.sh > /dev/null 2>&1 &

开机启动 /usr/lib/gsd-xsettings ,往 ~/.i3/config 加入

1
exec_always --no-startup-id nohup /usr/lib/gsd-xsettings > /dev/null 2>&1 &

系统语言非中文时,中文全显示成方块,需要在 /opt/deepinwine/tools/run.sh 中将 WINE_CMD 那一行修改为

1
WINE_CMD="LC_ALL=zh_CN.UTF-8 deepin-wine"

WeChat

1
2
yay -S deepin-wine-wechat
/opt/deepinwine/apps/Deepin-WeChat/run.sh

python

when-changed: 监控文件变动并且执行命令

1
pip3 install when-changed
1
pip3 install ipdb