一些偏好配置

省得每次装完系统大眼瞪小眼.bash

.bashrc

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
# A cleaner PS1
exitstatus () {
    last_return=$?
    if [[ $last_return != 0 ]] ; then
        echo "[$last_return] "
    fi
}

PS1='$(exitstatus)\[\e[0;2m\]\w \[\e[0m\]\$ \[\e[0m\]'
# (?)
alias doas='sudo'

set bell-style none

# Cross compilation environment
xde-aarch64-10_2 () {
    export ARCH=arm64
    export PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin:$PATH
    export CROSS_COMPILE=arm-none-eabi-
    export XC=$CROSS_COMPILE
    export PS1="(aarch64-gcc10)$PS1"
}

# Thiccpad fan control
fan () {
    if [ -e /proc/acpi/ibm/fan ] ; then
        if [[ $# -lt 1 ]] ; then
            cat /proc/acpi/ibm/fan
        else
            echo "level $1" | sudo tee /proc/acpi/ibm/fan
        fi
    else
        echo 'Probably not a Thinkpad!'
    fi
}

fish的兼容性过于残念,zsh的功能又有不少用不到,但有些简便功能反而影响工作效率,最后还是变回了bash的形状.jpg

.vimrc

1
2
3
set expandtab
set autoindent
set smartindent

以前有一版配过ycm的好**炫酷的vimrc,结果给整丢了,以后可得好好记下来

.zshrc

1
2
3
setopt autocd
bindkey -e
PROMPT='%(?|%~ %#|%S%~ %#%s) '

.Xresources

需要在进入桌面环境后执行

xrdb --merge ~/.Xresources

可以写进启动脚本。

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
xterm*faceName: Sarasa Fixed J
xterm*faceSize: 10
xterm*forcePackedFont: false

! My off-brand Monokai Pro theme

*xterm*background: #403e41
*xterm*foreground: #fcfcfa
*xterm*cursorColor: #fcfcfa
*xterm*color0: #403e41
*xterm*color1: #ff6188
*xterm*color2: #a9dc76
*xterm*color3: #ffd866
*xterm*color4: #fc9867
*xterm*color5: #ab9df2
*xterm*color6: #78dce8
*xterm*color7: #fcfcfa
*xterm*color8: #727072
*xterm*color9: #ff6188
*xterm*color10: #a9dc76
*xterm*color11: #ffd866
*xterm*color12: #fc9867
*xterm*color13: #ab9df2
*xterm*color14: #78dce8
*xterm*color15: #fcfcfa

为被迫使用[u]xterm的环境提供一点点eye candy

alacritty.yml

20220920更新 用不了konsole但又不至于xterm的时候——

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
font:
    normal:
        family: Sarasa Fixed SC
    size: 13.0

# Colors (Monokai Pro)
colors:
    # Default colors
    primary:
        background: '#2D2A2E'
        foreground: '#FCFCFA'

    # Normal colors
    normal:
        black:   '#403E41'
        red:     '#FF6188'
        green:   '#A9DC76'
        yellow:  '#FFD866'
        blue:    '#FC9867'
        magenta: '#AB9DF2'
        cyan:    '#78DCE8'
        white:   '#FCFCFA'

    # Bright colors
    bright:
        black:   '#727072'
        red:     '#FF6188'
        green:   '#A9DC76'
        yellow:  '#FFD866'
        blue:    '#FC9867'
        magenta: '#AB9DF2'
        cyan:    '#78DCE8'
        white:   '#FCFCFA'

注:alacritty Windows版启动之后路径可能是system32,将快捷方式属性里面的Start in设置为%USERPROFILE%即可。