- 更改源
- 软件安装
- vimrc中写入
- 自动执行键盘映射
- 关闭某个程序
- 自动启动字体
- 关于 —no-start-id
- - 在开机启动中一并列出
- - 当启动了某些并不支持启动提醒的某脚本或程序时,鼠标指针会逗留在忙碌状态六十秒以上。
- - 为防止此现象,凡是 exec 命令都均加 —no-startup-id 后缀
- i3 常用执行终端命令的 dmenu,也可替代
- 更换主题 lxappearance
- 更换壁纸 feh
- 壁纸管理器 variety
- i3-gaps
- 修剪视频 kdenlive
- 修图 gimp
- 虚拟机 virtualbox
- 微信
- ranger 文件管理器
- 安装录屏软件 simplescreenrecorder
- 截图软件 deepin-screenshot
- nvm
- 操作
更改源
# 选择中国源并更新,此时会出现一个界面
sudo pacman-mirrors -i -c China -m rank
# 更新系统
sudo pacman -Syyu
在 /etc/pacman.conf
文件中添加如下语句:
[archlinuxcn]
SigLevel = Optional TrustAll
Server = http://repo.archlinuxcn.org/$arch
# 配置失败的源,问题未知
# [archlinuxcn]
# SigLevel = Optional TrustAll
# Server = http://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
软件安装
chrome
sudo pacman -S google-chrome
:::info
安装完成后可以使用 google-chrome-stable
命令打开。如果想使用 chrome
命令打开,还需要进行下一步操作。
执行上述安装命令会在 /usr/bin
目录下创建名为 google-chrome-stable
的文件,此文件为 chrome 的启动文件,只需要创建一个名为 chrome
的副本即可。
:::
# 创建副本
sudo cp /usr/bin/google-chrome-stable /usr/bin/chrome
此时,输入 chrome
即可打开chrome浏览器。
Vim
sudo pacman -S vim
配置 vim
新建 ~/.vim/vimrc
文件
noremap new old
键盘映射,只改变在普通模式下的映射,不改变在插入模式下的映射。比如noremap n h
# 在普通模式下 n 也有 h 的作用,但在插入模式下,仍为 n
map new old
快捷键映射,比如" 按下大写 S,就会保存文件 map S :w<CR>
使用 vim-plug
# 安装 curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
```bash
vimrc中写入
call plug#begin(‘~/.vim/plugged’)
Plug ‘junegunn/vim-easy-align’
call plug#end()
运行 `:PlugInstall` 命令安装插件。
- 分屏
具体配置在 `~/.vim/vimrc` 中。
| 分屏操作 | 效果 |
| --- | --- |
| sj/sk/sl/sh | 向上、下、左、右分屏 |
| 空格+j/空格+k/空格+l/空格+h | 各屏之间移动 |
| 方向键 | 改变分屏的大小 |
在分屏中打开新文件:
- 输入命令: `:e fileName` 即可打开。
- tab 页
| tab页操作 | 效果 |
| --- | --- |
| tu | 新建一个 tab 页 |
| tn | 移向右侧的 tab 页 |
| ti | 移向左侧的 tab 页 |
<a name="ufJrS"></a>
## NeoVim
```bash
sudo pacman -S neovim
使用 nvim
命令打开。
zsh & oh-my-zsh
sudo pacman -S zsh
# 使用 zsh 替换 bash, 重启后生效
chsh -s /bin/zsh
# 安装 oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
更改 oh-my-zsh 的主题
编辑 ~/.zshrc
文件,修改文件的主题为:
ZSH_THEME="agnoster"
fish 终端的另一个选择
sudo pacman -S fish
# 改变终端默认项
chsh -s /usr/bin/fish
# 安装 oh-my-fish
curl -L https://get.oh-my.fish | fish
# 或者离线安装
git clone https://github.com/oh-my-fish/oh-my-fish
cd oh-my-fish
bin/install --offline
配置 fish
输入 fish_config
命令,即会打开 fish 配置界面。
输入法
sudo pacman -S fcitx-im # 默认全部安装
sudo pacman -S fcitx-configtool
sudo pacman -S fcitx-googlepinyin # 安装谷歌拼音(搜狗不成功)
配置 ~/.xprofile
文件,写入:
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
VScode
- 在官网下载安装包,一般名为
code-stable-xxx.tar.gz
。 解压安装包到
/opt/
目录,会在该目录下生成VSCode-linux-x64
文件夹。sudo tar -zxvf code-stable-xxx.tar.gz -C /opt/
加上执行权限(一般有执行权限,不需要添加)‘
sudo chmod +x /opt/VSCode-linux-x64/code
加入系统环境
使用创建链接的方式:
sudo ln -s /opt/VSCode-linux-x64/code /usr/local/bin/code
:::info
至此,就可以通过 code
命令打开了。
:::
- 配置桌面图标
在
/usr/share/applications/
下创建名为visualstudiocode.desktop
文件sudo touch /usr/share/applications/visualstudiocode.desktop sudo vim /usr/share/applications/visualstudiocode.desktop
[Desktop Entry] Name=Visual Studio Code Comment=Multi-platform code editor for Linux Exec=/opt/VSCode-linux-x64/code Icon=/usr/share/icons/code.png Type=Application StartupNotify=true Categories=TextEditor;Development;Utility; MimeType=text/plain;
将图标复制到
/usr/share/icons/
目录下:sudo cp /opt/VSCode-linux-x64/resources/app/resources/linux/code.png /usr/share/icons
nvmDescription=’A simple WPA encrypted wireless connection’
sudo pacman -S nvm
i3
sudo pacman -S i3
# 选择全部安装
netctl
sudo pacman -S netctl
# 将配置文件模板复制到 /etc/netctl/下
sudo cp /etc/netctl/examples/wireless-wpa /etc/netctl/
# 修改 wireless-wpa
vim wireless-wpa
Description='A simple WPA encrypted wireless connection'
Interface=wlo1 # 使用 ifconfig 命令查看无线网卡名称
Connection=wireless
Security=wpa
IP=dhcp
ESSID='TP-LINK_Mango' # 无线名称
# Prepend hexadecimal keys with \"
# If your key starts with ", write it as '""<key>"'
# See also: the section on special quoting rules in netctl.profile(5)
Key='maoquan1020' # 无线密码
# Uncomment this if your ssid is hidden
#Hidden=yes
# Set a priority for automatic profile selection
#Priority=10 # 如果有多个 WIFI,可以设置优先级
重启即可。
i3 的常规操作
快捷键 | 作用 | 备注 |
---|---|---|
Super+Enter | 新建一个终端 | 默认在右侧 |
Super+h Super+Enter | 在右侧新建一个终端 | |
Super+v Super+Enter | 在左侧新建一个终端 | |
Super+r | 调整窗口大小 | 使用方向键,按 Esc 退出 |
Super+Shift+方向键/hjgk | 移动窗口位置 | |
Super+Shift+Number | 移动窗口至特定桌面 | |
Super+Shift+r | ReStart | 一般用来重新加载配置文件 |
Super+Shift+q | 关闭当前的程序 | |
i3 配置文件
关闭某个程序
exec_always killall softwareName
自动启动字体
exec_alwaysd —no-startup-id fcitx
关于 —no-start-id
- 在开机启动中一并列出
- 当启动了某些并不支持启动提醒的某脚本或程序时,鼠标指针会逗留在忙碌状态六十秒以上。
- 为防止此现象,凡是 exec 命令都均加 —no-startup-id 后缀
- 设置窗口边框
new_window 1pixel
- <br />
<a name="jX0q7"></a>
## i3 常用终端 alacritty
```bash
sudo pacman -S alacritty
alacritty 的配置:
修改 i3 的配置文件使之默认打开 alacritty.
bindsym $mod+Retrun exec i3-sensible-terminal bindsym $mod+Retrun exec alacritty
修改 alacritty 配置文件
~/.config/alacritty/alacritty.yml
。如果没有配置文件,可以在其 Github 上下载配置文件。配置终端半透明
- 修改 alaritty.yml 配置文件,将
background_opacity
选项改小即可。 安装渲染器:compton
sudo pacman -S compton
将
compton
命令设置为开机自动启动。修改i3的配置文件exec_always --no-startup-id compton
i3 常用执行终端命令的 dmenu,也可替代
sudo pacman -S dmenu
# 在i3下,默认快捷键 Super+d
xorg 改变键盘映射
sudo pacman -S xorg # 全部安装
将所有的键盘映射导入配置文件
xmodmap -pke > ~/.xmodmap
修改要更改的键,一般为 CapsLock(66) 变为 Esc(9)。可以使用
xev
命令确认键码。- 重载配置文件
至此即可生效。xmodmap ~/.xmodmap
更换主题 lxappearance
sudo pacman -S lxappearance # 执行 lxappearance
更换壁纸 feh
sudo pacman -S feh
壁纸管理器 variety
sudo pacman -S variety # 在 dmenu 中打开图形界面即可
i3-gaps
提供窗口之间的间隙。
安装
sudo pacman -S i3-gaps
在 i3 配置文件中设置
gaps inner 15
修剪视频 kdenlive
sudo pacman -S kdenlive # 执行 kdenlive
修图 gimp
sudo pacman -S gimp # 执行 gimp
虚拟机 virtualbox
sudo pacman -S virtualbox
微信
sudo pacman -S electronic-wechat
ranger 文件管理器
sudo pacman -S ranger # 执行 ranger ranger # 退出 q
安装录屏软件 simplescreenrecorder
sudo pacman -S simplescreenrecorder # 执行 simplescreenrecorder
截图软件 deepin-screenshot
sudo pacman -S deepin-screenshot # 执行 deepin-screenshot
nvm
安装
sudo pacman -S nvm
nvm 不直接支持 fish,需要安装 fish 插件
omf install nvm
nvm 常用命令:
# 列出所有可安装的版本 nvm ls-remote # 列出已安装的版本 nvm ls # 安装特定版本的node nvm install 12.18.2 # 版本号 # 切换版本 nvm use 12.18.2
操作
在终端打开图片
xdg-open xxx.png
起别名 alias
安装 fish 之后,可以使用
# 列出所有的别名 alias # 创建别名 alias newName "old Name" # 保存别名 funcsave newName