Linux-Shell美化-Fish&ohmyposh
[参考这篇博客]https://ml.bayesianovich.top/article/12db4c44-ff79-802c-8f3f-e5cb4bfd0da4
我的主题与其他配置
{
"palette": {
"os": "#ACB0BE",
"closer": "p:os",
"pink": "#F4B8E4",
"lavender": "#BABBF1",
"blue": "#8CAAEE"
},
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "p:os",
"style": "plain",
"template": "{{.Icon}} ",
"type": "os"
},
{
"foreground": "p:blue",
"style": "plain",
"template": "{{ .UserName }}@{{ .HostName }} ",
"type": "session"
},
{
"foreground": "p:pink",
"properties": {
"folder_icon": "..\ue5fe..",
"home_icon": "~",
"style": "agnoster_short"
},
"style": "plain",
"template": "{{ .Path }} ",
"type": "path"
},
{
"foreground": "p:lavender",
"properties": {
"branch_icon": "\ue725 ",
"cherry_pick_icon": "\ue29b ",
"commit_icon": "\uf417 ",
"fetch_status": false,
"fetch_upstream_icon": false,
"merge_icon": "\ue727 ",
"no_commits_icon": "\uf0c3 ",
"rebase_icon": "\ue728 ",
"revert_icon": "\uf0e2 ",
"tag_icon": "\uf412 "
},
"template": "{{ .HEAD }} ",
"style": "plain",
"type": "git"
},
{
"style": "plain",
"foreground": "p:closer",
"template": "\uf105",
"type": "text"
}
],
"type": "prompt"
},
{
"alignment": "right",
"segments": [
{
"foreground": "p:wight",
"style": "plain",
"template": "<#cc7eda></><#7eb8da>RAM:</> {{ (div ((sub .PhysicalTotalMemory .PhysicalFreeMemory)|float64) 1073741824.0) }}/{{ (div .PhysicalTotalMemory 1073741824.0) }}GB",
"type": "sysinfo"
},
{
"foreground": "p:wight",
"style": "plain",
"template": "<#cc7eda> </><#7eb8da>\u23F1 </> {{ .FormattedMs }}",
"type": "executiontime"
},
{
"foreground": "p:wight",
"properties": {
"time_format": "15:04:05"
},
"style": "plain",
"template": "<#cc7eda> </>{{ .CurrentDate | date .Format }}",
"type": "time"
},
{
"type": "python",
"style": "plain",
"foreground": "p:wight",
"template": "<#cc7eda> </> {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }} "
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"foreground": "p:blue",
"style": "plain",
"template": "\u2570\u2500",
"type": "text"
}
],
"type": "prompt"
}
],
"final_space": true,
"version": 3
}
sudo nano ~/.config/fish/config.fish
添加
alias cc="clear"
alias ls="eza --icons"
alias ll="eza --icons -l"
alias ff="fastfetch"
oh-my-posh init fish --config ~/AquaTime.omp.json | source
export PATH="/opt/nvim-linux64/bin:$PATH"
eza安装:[eza官网]https://eza.rocks/
sudo apt update
sudo apt install -y gpg
sudo mkdir -p /etc/apt/keyrings
wget -qO- https://raw.githubusercontent.com/eza-community/eza/main/deb.asc | sudo gpg --dearmor -o /etc/apt/keyrings/gierens.gpg
echo "deb [signed-by=/etc/apt/keyrings/gierens.gpg] http://deb.gierens.de stable main" | sudo tee /etc/apt/sources.list.d/gierens.list
sudo chmod 644 /etc/apt/keyrings/gierens.gpg /etc/apt/sources.list.d/gierens.list
sudo apt update
sudo apt install -y eza