Kali配置i3wm教程1

Kali Linux 配置 i3wm 平铺式桌面完整教程

环境 :全新安装的 Kali Rolling,普通用户(有 sudo 权限)、能联网,物理机或 VMware 虚拟机均可。

做法:按下面的步骤从第 1 步做到第 10 步,每步都是"做什么 → 文件写什么 → 怎么验证"。

开始前记住三条,能省几小时排错:

  1. 改完 i3 配置立刻校验:i3 -C -c ~/.config/i3/config------i3 有语法错误会整份拒绝加载;
  2. 字体族名必须与 fc-list 输出完全一致------差一个 Solid 后缀,图标全变方块且无报错;
  3. 配置里别留不存在的路径------不报错,但壁纸/图标等功能静默失效。

约定 :$mod = Alt 键;~/ = 你的家目录;带 sudo 的命令需要输登录密码;

文中 IP、/home/sirius 等均为示例,替换成你自己的。

出问题先查 排错手册 ,配置原文都在 附录 A。

效果图如下

第 1 步:安装组件

1.1 先更新系统

bash 复制代码
sudo apt update && sudo apt full-upgrade -y

如果 apt update 卡在某个源、或者下载速度像停住:

加 -o Acquire::ForceIPv4=true(国内部分镜像 IPv6 不通,见坑 1)。

1.2 一次装全(复制整段执行)

bash 复制代码
sudo apt install -y --no-install-recommends \
  i3 i3status i3lock xss-lock xautolock \
  polybar feh dunst xcompmgr \
  lxpolkit lxappearance mate-power-manager network-manager-gnome \
  rofi ranger fzf dmenu xfce4-appfinder nautilus konsole \
  blueman copyq papirus-icon-theme \
  scrot imagemagick pulseaudio-utils pavucontrol \
  fastfetch jq xinput xdotool x11-xserver-utils \
  zsh zsh-autosuggestions zsh-syntax-highlighting lolcat git curl \
  fonts-firacode fonts-font-awesome fonts-font-awesome-legacy \
  fonts-hack fonts-cantarell fonts-wqy-microhei fonts-wqy-zenhei \
  fonts-symbola fonts-noto-color-emoji

1.3 每个包是干什么的(出问题好定位)

分组 包 用途
窗口管理 i3 i3status 平铺窗口管理器本体及其状态源(状态栏用 polybar,不启用 i3bar)
锁屏 i3lock xss-lock xautolock 锁屏程序 / 休眠前自动锁 / 无操作 N 分钟自动锁
状态栏 polybar 顶部状态栏
壁纸 feh 设壁纸(nitrogen 已从 Kali 源移除,见坑 2)
通知 dunst 系统通知弹窗
合成器 xcompmgr 提供透明/阴影(polybar 和 rofi 的圆角依赖它)
认证 lxpolkit 图形化输入密码的授权弹窗(替代已移除的 policykit-1-gnome)
外观 lxappearance papirus-icon-theme GTK 主题/图标设置;rofi -show-icons 的图标来自图标主题
电源 mate-power-manager 电池托盘(笔记本/虚拟机可关)
网络 network-manager-gnome nm-applet 网络托盘图标
蓝牙 blueman blueman-applet 蓝牙托盘
启动器 rofi dmenu xfce4-appfinder 主用 rofi,另两个是可选的习惯键位
文件管理 nautilus ranger 图形文件管理器 / 终端文件管理器
终端 konsole 本文主力终端
剪贴板 copyq 剪贴板历史(i3 自启里有它)
截图/图像 scrot imagemagick 截屏(锁屏背景)+ convert 模糊处理
音频 pulseaudio-utils pavucontrol pactl(音量键必需,漏装则音量键全无反应)/ 图形音量面板
系统信息 fastfetch 代替已移除的 neofetch(见坑 3)
脚本依赖 jq xinput xdotool x11-xserver-utils USB 模块解析 JSON / 打字速度统计 / 模拟按键测试 / xset 等 X 工具
shell zsh zsh-autosuggestions zsh-syntax-highlighting lolcat 交互 shell 及其插件、彩色输出
网络下载 git curl 装 zim 框架、下载 daily-poem 用
字体 见下一章 图标和等宽字体,少一个就满屏方块

可选(本文配置里用到,但你可以不做):

bash 复制代码
# 浏览器(i3 里 Alt+Shift+g 绑定的是 google-chrome)
wget -q -O /tmp/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && sudo apt install -y /tmp/chrome.deb

# uTools 效率工具(i3 自启里有 /usr/bin/utools,不装就删那一行)

1.4 验证软件包是否真的装上了

bash 复制代码
for c in i3 polybar rofi konsole feh dunst xcompmgr scrot convert pactl \
         fastfetch jq xinput xdotool xautolock lxpolkit nm-applet zsh; do
  printf '%-12s %s\n' "$c" "$(command -v "$c" || echo '❌ 缺失')"
done

出现 ❌ 缺失 就单独补装,别往下走------pactl 缺了音量键会完全无反应,convert 缺了锁屏会变成纯黑屏。


第 2 步:字体与目录骨架

2.1 字体自查(图标显示的前提)

polybar 的状态栏图标、rofi 的图标、提示符的符号,全部依赖特定字体存在 。

先确认这几族字体在不在(族名必须一模一样):

bash 复制代码
fc-list : family | tr ',' '\n' | sort -u | grep -iE "Font Awesome|Symbola|Noto Color Emoji|Fira Code|WenQuanYi|DejaVu Sans"

你至少要看到下面这些(左边是族名,右边是对应的 apt 包):

族名(配置里要写这个) 由哪个包提供 用在哪
Font Awesome 5 Free Solid fonts-font-awesome 状态栏图标(CPU/内存/音量等)
Font Awesome 7 Brands 可能要手工装(见 2.2) 品牌图标(Chrome、GitHub 等)
Symbola fonts-symbola 状态栏 emoji(🐏 🌐 🔊)必须是它,不能是彩色 emoji
Noto Color Emoji fonts-noto-color-emoji 兜底(排在 Symbola 后面)
Fira Code fonts-firacode konsole 终端 + rofi 文字
WenQuanYi Micro Hei fonts-wqy-microhei 锁屏的中文时间/日期/提示
DejaVu Sans 系统自带 ↑↓ █░ 之类符号

2.2 如果 Font Awesome 7 Brands 没有

这个族名是 Font Awesome 6/7 的 fa-brands-400.ttf 提供的,Kali 源里的 fonts-font-awesome 版本不一定带。

它只影响品牌图标 (不影响 CPU/内存/音量这些核心图标),没有也能用,polybar 会自动回退到后面的字体。

想要的话手工装一份(不需要 root):

bash 复制代码
mkdir -p ~/.local/share/fonts
# 从 Font Awesome 官网或 GitHub 下载 fa-brands-400.ttf 后:
cp fa-brands-400.ttf ~/.local/share/fonts/
fc-cache -f ~/.local/share/fonts
fc-list | grep -i "awesome 7 brands"    # 能看到这一行就成功了

2.3 图标变方块时的排查顺序(重要)

按这个顺序查,别乱试:

bash 复制代码
# ① 这个族名到底存不存在(把配置里写的名字原样贴进去)
fc-match "Font Awesome 5 Free Solid"
#   输出里如果是别的字体名(如 WenQuanYi),说明没匹配上 → 族名写错了

# ② 这个字符由哪个字体提供(把图标字符贴进去)
fc-match -s "🌐" | head -3

# ③ polybar 会告诉你哪个字体匹配失败
polybar mybar -l info 2>&1 | grep -i font

最常见的错 :配置里写 Font Awesome 5 Free,但实际注册的族名是

Font Awesome 5 Free Solid。少一个 Solid 就整排图标空白(坑 6)。

2.4 建立目录骨架

一条命令把要用的目录全建好(重复执行无害):

bash 复制代码
mkdir -p ~/.config/i3/scripts \
         ~/.config/polybar/scripts \
         ~/.config/rofi \
         ~/.local/share/konsole \
         ~/Pictures/wallpapers

各目录装什么:

目录 内容
~/.config/i3/ config(主配置)+ scripts/(音量脚本)
~/.config/polybar/ config、launch.sh、netinfo.sh、scripts/(天气/USB/诗词)
~/.config/rofi/ config.rasi(启动器主题)
~/.local/share/konsole/ profile(字体字号)和 colorscheme(配色)
~/Pictures/wallpapers/ 壁纸放这里,本文统一用 wall.jpg 这个名字

第 3 步:i3 主配置

3.0 把完整配置写进文件

i3 的配置只有一个文件 :~/.config/i3/config。完整的 322 行配置见 附录 A.1,直接整份复制保存即可。

bash 复制代码
mkdir -p ~/.config/i3
nano ~/.config/i3/config      # 把附录 A.1 的全文整段粘贴进去,保存

该文件开头带注释说明它是 i3-config-wizard 生成的------不用管 ,只改内容、不重跑向导。

新装 i3 第一次登录会弹向导问 Win 还是 Alt 作修饰键,随便选(选完就会被本文的配置覆盖)。

写完立刻校验语法:

bash 复制代码
i3 -C -c ~/.config/i3/config && echo "✅ 配置语法通过"

这一步不通过,后面所有步骤都白做------i3 加载失败会退回默认配置,你会以为"改了没用"。

下面是这份配置逐段的讲解。先看讲解,再去 4.5 改自己机器要改的几处。

3.1 修饰键与基础设置

复制代码
set $mod Mod1        # Alt 作为主修饰键(Mod4 = Win 键,按喜好选)

new_window pixel 2   # 窗口 2px 细边框
new_float normal
hide_edge_borders both

gaps inner 12        # 窗口间隙 12px,更透气
  • set $mod Mod1:把 Alt 定义成变量 $mod,后面所有快捷键都写成 $mod+xxx
  • new_window pixel 2:窗口用 2px 像素边框(不是标题栏)
  • hide_edge_borders both:单窗口/贴边时不画外边框,视觉更干净
  • gaps inner 12:平铺窗口之间留 12px 空隙

3.2 窗口颜色(必须写满 5 个颜色位!)

复制代码
set $bg-color          #2f343f
set $inactive-bg-color #2f343f
set $text-color        #f3f4f5
set $inactive-text-color #676E7D
set $urgent-bg-color   #E53935
set $focus-border      #2bcec2
set $inactive-border   #3b4252

# 边框  背景  文本  指示条  子边框(pixel边框实际显示的颜色)
client.focused          $focus-border    $bg-color          $text-color          $focus-border    $focus-border
client.unfocused        $inactive-border $inactive-bg-color $inactive-text-color $inactive-border $inactive-border
client.focused_inactive $inactive-border $inactive-bg-color $inactive-text-color $inactive-border $inactive-border
client.urgent           $urgent-bg-color $urgent-bg-color   $text-color          $urgent-bg-color $urgent-bg-color

坑 4 :new_window pixel 模式下,实际渲染的是第 5 个颜色位(child_border)。

如果只写 4 个颜色,边框会莫名变成第 4 位(indicator)的颜色(比如亮绿色)。

5 个颜色位全部显式写上最稳妥。

3.3 常用快捷键

下面只是节选 (完整键位见附录 A.1,322 行)。注意真实配置里"锁屏/退出/重启/关机"

走的是 mode_system 模式菜单:先按 Alt+Shift+Ctrl+q,再按 l/e/r/o。

复制代码
bindsym $mod+Return exec konsole          # 终端
bindsym $mod+d exec --no-startup-id rofi -show drun -theme ~/.config/rofi/config.rasi -show-icons
bindsym $mod+z exec nautilus              # 文件管理器
bindsym $mod+Shift+g exec google-chrome   # 浏览器
bindsym $mod+m exec ~/.config/polybar/launch.sh   # 启动状态栏
bindsym $mod+Shift+m exec killall polybar         # 关闭状态栏
bindsym $mod+Shift+c reload               # 重载配置
bindsym $mod+Shift+r restart              # 重启 i3
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m '退出?' -b yes 'i3-msg exit'"

3.4 开机自启动

附录 A.1 里的自启动段(exec --no-startup-id ...)实际是这些,逐行对应:

复制代码
exec --no-startup-id blueman-applet        # 蓝牙托盘
exec --no-startup-id lxpolkit              # 认证弹窗(图形化输密码)
exec --no-startup-id vmware-user-suid-wrapper   # VMware 工具,物理机删掉
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lockr --blur 60   # 休眠前自动锁屏
exec --no-startup-id /usr/bin/utools       # uTools 效率工具,不装就删
exec_always feh --randomize --bg-fill 图片/壁纸/浏览器/xxx.jpg             # 壁纸,改路径
exec --no-startup-id copyq                 # 剪贴板历史
exec --no-startup-id nm-applet             # 网络托盘图标
exec --no-startup-id ~/.config/polybar/launch.sh   # 状态栏
exec --no-startup-id xcompmgr              # 合成器(透明/圆角)
exec --no-startup-id dunst                 # 系统通知
exec --no-startup-id xautolock -time 10000 -locker i3lockr --blur 60       # 10 分钟无操作自动锁

mate-power-manager(电池托盘)在 A.1 里是注释掉 的,需要就删掉行首的 #。

三处锁屏(Alt+l、xss-lock、xautolock)都调用 i3lockr,所以脚本必须先建好(第 4 步 4.4)。

3.5 必须按你的机器改的地方(不改会出问题)

附录 A.1 是完整配置,其中若干行与本机环境相关(第三方软件、特定壁纸路径等)。

这些路径在你机器上不存在时,程序通常不报错、只是功能不生效。按表逐条处理:

在 A.1 里的行 内容 你该怎么改
自启动 exec --no-startup-id /usr/bin/utools 不装 uTools 就删掉整行
自启动 exec --no-startup-id vmware-user-suid-wrapper 物理机删掉整行;VMware 里保留
自启动 exec_always feh --randomize --bg-fill 图片/壁纸/浏览器/20230827170427.jpg 改成你的壁纸路径(见下)
快捷键 bindsym $mod+Ctrl+1 ~ $mod+Ctrl+0(10 行壁纸轮换) 没有这些图就整段删掉
快捷键 bindsym $mod+Shift+g exec google-chrome 没装 Chrome 就删,或改成 firefox
快捷键 bindsym $mod+z exec nautilus 你用 thunar 就改 thunar

一键处理(壁纸统一成 ~/Pictures/wallpapers/wall.jpg):

bash 复制代码
# 1) 放一张你的壁纸进统一位置(把 /path/to/你的图.jpg 换成实际路径)
cp /path/to/你的图.jpg ~/Pictures/wallpapers/wall.jpg

# 2) 把所有壁纸路径统一改成新路径
sed -i 's|图片/壁纸/浏览器/[^ "]*|Pictures/wallpapers/wall.jpg|g; s|图片/壁纸/[^ "]*|Pictures/wallpapers/wall.jpg|g' ~/.config/i3/config

# 3) 删掉 10 个壁纸轮换快捷键($mod+Ctrl+数字)
sed -i '/bindsym \$mod+Ctrl+[0-9]/d' ~/.config/i3/config

# 4) 不装 uTools / 物理机 → 删掉对应自启行
sed -i '/utools/d; /vmware-user-suid-wrapper/d' ~/.config/i3/config

# 5) 重新校验
i3 -C -c ~/.config/i3/config && echo "✅ 改完仍通过"

别跳过第 5 步。上面的 sed 是文本替换,改错一行就是语法错误。

3.6 应用配置

bash 复制代码
# 当前会话里直接生效(Alt+Shift+c 等价)
i3-msg reload

# 语法有问题时,i3 的报错在这里
i3-msg -t get_version

首次配完建议注销重新登录,让自启动项全部按新配置跑一遍。


第 4 步:音量与锁屏脚本

i3 主配置里引用了两个脚本目录 + 一个系统级脚本。这三个必须存在并且可执行,否则快捷键按了没反应。

脚本 路径 全文
音量加(100% 封顶) ~/.config/i3/scripts/volup.sh 下面 4.2
音量减 ~/.config/i3/scripts/voldown.sh 下面 4.3
锁屏美化 /usr/local/bin/i3lockr 坑 18(含依赖安装)

4.1 为什么音量要单独写脚本

i3 默认绑定是 pactl set-sink-volume @DEFAULT_SINK@ +10%,而 pactl 允许音量超过 100% 。

按住音量+键时键盘会自动重复触发,几秒钟就能冲到 2350%(82 dB)------声音严重削波失真,还伤耳朵和喇叭。

所以加音量这一步要自己做上限保护(坑 19)。

4.2 ~/.config/i3/scripts/volup.sh

bash 复制代码
#!/bin/sh
# 加大音量:步进 10%,上限 100%(超过 100% 会削波失真)
export XDG_RUNTIME_DIR=/run/user/$(id -u)

# 读当前音量:pactl 输出形如 "Volume: front-left: 32768 / 50% / -18.06 dB, ..."
# head -1 取第一行 → grep -o 抠出 "50%" → tr -d 去掉百分号
V=$(pactl get-sink-volume @DEFAULT_SINK@ | head -1 | grep -o "[0-9]*%" | head -1 | tr -d "%")
[ -z "$V" ] && exit 0

# 91% 以上再加 10 会冲过 100,直接精确设到 100 封顶
if [ "$V" -ge 91 ]; then
  pactl set-sink-volume @DEFAULT_SINK@ 100%
else
  pactl set-sink-volume @DEFAULT_SINK@ +10%
fi

4.3 ~/.config/i3/scripts/voldown.sh

bash 复制代码
#!/bin/sh
# 降低音量:步进 10%(0% 是天然下限,不需要保护)
export XDG_RUNTIME_DIR=/run/user/$(id -u)
pactl set-sink-volume @DEFAULT_SINK@ -10%

创建并授权:

bash 复制代码
mkdir -p ~/.config/i3/scripts
# 把上面两段分别存成 volup.sh 和 voldown.sh 后:
chmod +x ~/.config/i3/scripts/volup.sh ~/.config/i3/scripts/voldown.sh
# 立即测一下(应能看到音量数值变化)
~/.config/i3/scripts/volup.sh && pactl get-sink-volume @DEFAULT_SINK@ | head -1

坑 :pactl 必须装 pulseaudio-utils。漏装时按键完全无反应且没有任何报错 ,

这是最容易漏查的一项(坑 17)。

4.4 锁屏脚本 i3lockr

i3 配置里有三处锁屏引用(Alt+l、xss-lock 休眠锁、xautolock 10 分钟自动锁),全都调 i3lockr。

i3lockr 是一个自建脚本 (Kali 仓库里没有这个程序,需要自己建),它负责"截图 → 模糊 → 上锁"。

依赖两样:

bash 复制代码
# ① 截图工具(第 1 步已装)
sudo apt install -y scrot imagemagick

# ② i3lock-color(普通 i3lock 不支持时钟/圆环,且它和系统包冲突,解包安装)
curl -fsSL -o /tmp/i3lock-color.deb \
  "http://http.kali.org/kali/pool/main/i/i3lock-color/i3lock-color_2.13.c.5-0kali1_amd64.deb"
sudo dpkg-deb -x /tmp/i3lock-color.deb /tmp/i3lc
sudo cp /tmp/i3lc/usr/bin/i3lock /usr/local/bin/i3lock-color
sudo chmod +x /usr/local/bin/i3lock-color && rm -rf /tmp/i3lc /tmp/i3lock-color.deb

然后是脚本本体 /usr/local/bin/i3lockr------全文、逐行注释、每个参数的含义都在排错手册坑 18 ,

把那段整块存成该文件再 sudo chmod +x /usr/local/bin/i3lockr 即可。

可以先不配锁屏 :没配好时 Alt+l 只会闪一下没反应,不影响其他功能。

建议先把桌面整体跑通,最后再按坑 18 把脚本补齐。
--blur 60 是什么 :配置里三处都写成 i3lockr --blur 60,这个参数来自社区版 i3lockr

的模糊半径写法。本文的脚本不认识它、会直接忽略 ,完全不影响使用,

所以 i3 里的绑定一个字都不用改 (要调模糊程度就改脚本里 convert 那一行)。

4.5 权限一次性检查

bash 复制代码
ls -l ~/.config/i3/scripts/ ~/.config/polybar/launch.sh ~/.config/polybar/netinfo.sh 2>/dev/null
# 每个脚本都要有 x(如 -rwxr-xr-x)。没有就 chmod +x 补上

第 5 步:polybar 状态栏

5.0 文件清单

复制代码
~/.config/polybar/
├── config            # 主配置(附录 A.2,837 行,全部模块)
├── launch.sh         # 启动脚本(附录 A.3)  chmod +x
├── netinfo.sh        # 网卡自动检测(本文 6.3)  chmod +x
└── scripts/          # 附加脚本(附录 A.4 / A.4b~d),全部 chmod +x
    ├── daily-poem                 # 今日诗词二进制(GitHub 下载,见 5.6)
    ├── poem.txt                   # 诗词备用语料
    ├── info-hackspeed.sh          # 打字速度
    ├── openweathermap-fullfeatured.sh  # 天气(需自己的 API key)
    └── system-usb-udev.sh         # USB 插拔监控

一次把该给权限的都给了:

bash 复制代码
chmod +x ~/.config/polybar/launch.sh ~/.config/polybar/netinfo.sh ~/.config/polybar/scripts/*.sh

5.1 基本结构

复制代码
~/.config/polybar/
├── config          # 主配置
├── launch.sh       # 启动脚本(chmod +x)
└── scripts/        # 自定义模块脚本(每日诗词、USB 监控等)

launch.sh 的作用就三步:杀掉旧 polybar 实例 → 等它退干净 → 启动 mybar

(mybar 是 config 里 [bar/mybar] 这个名字)。全文见 附录 A.3(12 行,带日志输出)。

5.2 内存模块:百分比 + Mem 字样

ini 复制代码
[module/memory]
type = internal/memory
interval = 1
format = <label>          ; 已去掉渐变色条(省空间),想加回来改为 <label> <bar-used>
format-padding = 2
format-underline = #FFA07A

; 内存用量渐变色条(低→高:绿→黄→橙→红)
label = Mem%percentage_used%%   ; 芯片图标+Mem 字样,与 CPU 模块(CPU%percentage%%)风格一致
bar-used-width = 10
bar-used-foreground-0 = #90EE90
bar-used-foreground-1 = #f1fa8c
bar-used-foreground-2 = #fba922
bar-used-foreground-3 = #dd2727
bar-used-fill = █
bar-used-empty = ░
bar-used-empty-foreground = #555555
bar-used-indicator =

坑 5 :%gb_total% 显示的是本机真实内存。别像网上教程一样写死 /16GiB,

内存只有 4G 的机器会显示错误数据。

5.3 网络模块:自动检测网卡 + 显示 IP + 合计网速(支持多网卡)

坑 6a :internal/network 模块的 interface 是写死的 。

双网卡机器(eth0 + eth1)断开 eth0 后,绑死 eth0 的模块会一直显示"网线未连接",

根本不会去看 eth1。正确做法是用脚本模块自动检测当前有 IP 的网卡。

第一步:创建自动检测脚本 ~/.config/polybar/netinfo.sh(chmod +x):

bash 复制代码
#!/bin/bash
# 自动检测所有有全局 IPv4 的网络接口(优先有线 eth*,其次无线 wl*)
# 用法: netinfo.sh ip|up|down
MODE="$1"

IFACES=$(ip -4 -o addr show scope global 2>/dev/null | awk '{print $2}' | grep -E '^(eth|en)')
[ -z "$IFACES" ] && IFACES=$(ip -4 -o addr show scope global 2>/dev/null | awk '{print $2}' | grep -E '^(wl|wlan)')

case "$MODE" in
    ip)
        if [ -z "$IFACES" ]; then
            echo "网线未连接"
        else
            # 每块活跃网卡都显示 "网卡名:完整IP"
            OUT=""
            for IFACE in $IFACES; do
                IP=$(ip -4 -o addr show dev "$IFACE" scope global | awk '{print $4}' | cut -d/ -f1)
                OUT="$OUT$IFACE:$IP "
            done
            echo "🌐 $OUT"
        fi
        ;;
    up|down)
        [ -z "$IFACES" ] && exit 0
        if [ "$MODE" = "up" ]; then F="tx_bytes"; SF="/tmp/.pb_tx_multi"
        else F="rx_bytes"; SF="/tmp/.pb_rx_multi"; fi
        # 汇总所有活跃接口的当前字节数,形如 "eth0:123 eth1:456"
        CUR=""
        for IFACE in $IFACES; do
            C=$(cat "/sys/class/net/$IFACE/statistics/$F" 2>/dev/null) || continue
            CUR="$CUR$IFACE:$C "
        done
        [ -z "${CUR// }" ] && exit 0
        PREV=$(cat "$SF" 2>/dev/null)
        echo "$CUR" > "$SF" 2>/dev/null
        [ -z "$PREV" ] && exit 0
        # 接口集合变化时(刚插拔网卡)跳过一次,避免差值错乱
        PREV_SET=$(echo "$PREV" | tr ' ' '\n' | grep -v '^$' | cut -d: -f1 | sort | tr '\n' ' ')
        CUR_SET=$(echo "$CUR" | tr ' ' '\n' | grep -v '^$' | cut -d: -f1 | sort | tr '\n' ' ')
        [ "$PREV_SET" != "$CUR_SET" ] && exit 0
        # 计算各接口差值合计(polybar 轮询间隔 3 秒)
        DIFF=0
        for pair in $CUR; do
            IF=${pair%%:*}; C=${pair##*:}
            PC=$(echo "$PREV" | tr ' ' '\n' | grep "^$IF:" | cut -d: -f2)
            if [ -n "$PC" ]; then
                D=$((C - PC)); [ "$D" -gt 0 ] && DIFF=$((DIFF + D))
            fi
        done
        SPEED=$((DIFF / 3)); [ "$SPEED" -lt 0 ] && SPEED=0
        if [ "$SPEED" -ge 1048576 ]; then
            awk -v s="$SPEED" 'BEGIN{printf "%6.1f MiB/s", s/1048576}'
        elif [ "$SPEED" -ge 1024 ]; then
            awk -v s="$SPEED" 'BEGIN{printf "%6.1f KiB/s", s/1024}'
        else
            printf "%4d B/s" "$SPEED"
        fi
        ;;
esac

第二步:polybar 配置里三个网络模块全部改走脚本:

ini 复制代码
[module/wired-network]
type = custom/script
exec = ~/.config/polybar/netinfo.sh ip
interval = 3.0
format-underline = #912CEE
label = %output%
label-foreground = ${colors.warning}

[module/eth-upload]
type = custom/script
exec = ~/.config/polybar/netinfo.sh up
interval = 3.0
format-underline = #FFE4E1
label = ↑ %output%

[module/eth-download]
type = custom/script
exec = ~/.config/polybar/netinfo.sh down
interval = 3.0
format-underline = #912CEE
label = ↓ %output%

效果:

  • 单网卡 → 🌐 eth0:10.10.10.131(网卡名 + 完整 IP)
  • 两块网卡同开 → 🌐 eth0:10.10.10.131 eth1:10.175.61.124(两块卡的完整 IP 都显示)
  • 断任何一块 → 自动显示剩下那块;全断才显示"网线未连接"
  • ↑↓ 网速 = 所有活跃网卡的流量合计

坑 6b :通过 SSH 远程重启 polybar 必须带 DISPLAY=:0,

否则报 Can't parse display string 直接退出:

bash 复制代码
export DISPLAY=:0; setsid bash -c '~/.config/polybar/launch.sh' &

5.4 多网卡排障:接上了却一直没 IP

症状 :VMware 里 eth0 显示"已连接",但 ip addr 里 eth0 没有 inet 地址,

状态栏也不显示它。

排查链路(都是常见坑):

bash 复制代码
nmcli device status              # 看 eth0 是"已连接"还是"已断开"
sudo journalctl -u NetworkManager -n 40 | grep eth0   # 看 DHCP 日志

情况 A:NM 显示"已断开"且日志里 dhcp4 (eth0): state changed no lease

→ eth0 接的 VMware 虚拟网段里没有 DHCP 服务器 (常见于桥接到了

没 DHCP 的 VMnet,或宿主网络变了;也可能是 NAT 服务暂时抽风,稍后再连就好)。

解决:在 VMware 虚拟网络编辑器里修好该网段的 DHCP,或给 eth0 配静态 IP。

手动重试:nmcli connection up eth0-dhcp,成功后状态栏自动变双 IP 显示(如 .131 .124)。

情况 B:eth0 没有 connection profile,NM 每 10~20 秒后台重试一轮 DHCP

→ 日志里大量 eth0 记录。每次重试会短暂激活 eth0 抢路由,造成

系统周期性卡顿 (开终端慢、polybar 天气/诗词脚本 curl 卡超时等)。

止血:建一个 profile 并关掉自动重试:

bash 复制代码
sudo nmcli connection add type ethernet ifname eth0 con-name eth0-dhcp autoconnect no
sudo nmcli device disconnect eth0
# 以后想用 eth0:nmcli connection up eth0-dhcp

情况 C:只是不想用 eth0

→ 直接在 VMware 虚拟机设置里把第二块网卡的"已连接"勾掉,一了百了。

情况 D:新加了一块网卡但不显示 IP(或"断开一块另一块才能连")

→ VMware 里"已连接"只是物理层接通,网卡层还差连接配置:

核心坑:多块网卡共用一份档案,NM 规则是"一份档案同一时间只能激活在一张网卡上"。

新网卡没有专属档案时会去抢别人的(如 Wired connection 1),

表现为"抢椅子":谁先连上谁占住,其他卡显示"已断开";

断开占住的那块,空出的档案立刻被另一块抢走------

这就是"断开 eth0 后 eth1 就能获取到 IP"的原因。

解决:给每块网卡建专属档案 (ifname 绑定网卡名,一人一把椅子):

bash 复制代码
sudo nmcli connection add type ethernet ifname eth2 con-name eth2-dhcp autoconnect yes
sudo nmcli connection up eth2-dhcp     # 立即连接并 DHCP

建好后用 nmcli -f NAME,DEVICE,AUTOCONNECT connection show 确认每张卡

都有自己的档案(DEVICE 列各归各,不再共用一个)。

如果 DHCP 拿不到地址,参考情况 A 检查该网卡接的 VMnet 有没有 DHCP。

状态栏的 netinfo.sh 会自动把所有拿到 IP 的网卡都显示出来

(如 🌐 eth0:10.10.10.131 eth1:10.175.61.124 eth2:10.10.10.133),

网卡越多显示越长,1920 宽屏实测三卡不溢出。

5.5 图标字体(重要)

polybar 字体栈按顺序匹配,前面的字体没有的字形才会落到后面:

ini 复制代码
font-0 = fixed:pixelsize=13;1
font-1 = unifont:fontformat=truetype:size=13:antialias=false;0
font-2 = Noto Sans Symbols2:style=Regular:size=13
font-3 = Font Awesome 5 Free Solid:size=13   ; 注意族名必须带 Solid,fc-match 实测 'Font Awesome 5 Free' 匹配不上
font-5 = DejaVu Sans:style=Bold:size=12
font-6 = Symbola:size=11               ; ← emoji 图标用这个
font-7 = Noto Color Emoji:size=10      ; 兜底

坑 6 :不要让 Noto Color Emoji 优先渲染 emoji!它是位图字体,

在 polybar 里不随字号缩放,🐏 🌐 会变成巨大的色块。

正确做法:安装 fonts-symbola(矢量单色、跟随字号),排在彩色 emoji 之前。

注意 ↑↓、█░ 这类符号 DejaVu Sans 自带,不受影响。


5.6 今日诗词模块(daily-poem)怎么装

这个模块默认是注释掉的,原因是它有依赖坑:

  1. 下载二进制 :上游开源项目 https://github.com/Yucklys/polybar-daily-poem (Rust 编译产出的单个可执行文件)
    放到 ~/.config/polybar/scripts/daily-poem,然后 chmod +x。
  2. 它依赖 libssl.so.1.1,而新版 Kali 只有 libssl3 ,直接跑会报错。
    解决办法是不动系统包,把 1.1 的库解包到私有目录:
bash 复制代码
curl -sL -o /tmp/libssl11.deb \
  http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb
mkdir -p ~/.config/polybar/scripts/libssl11
dpkg -x /tmp/libssl11.deb ~/.config/polybar/scripts/libssl11
# 验证
LD_LIBRARY_PATH=$HOME/.config/polybar/scripts/libssl11/usr/lib/x86_64-linux-gnu \
  ~/.config/polybar/scripts/daily-poem --version
  1. 在 config 的 hook 前加库路径前缀 (附录 A.2 的 [module/daily-poem] 里已经是这个写法):

    hook-0 = LD_LIBRARY_PATH=$HOME/.config/polybar/scripts/libssl11/usr/lib/x86_64-linux-gnu ~/.config/polybar/scripts/daily-poem require <你的token> ~/.config/polybar/scripts/poem.txt

  2. token 到 https://v2.jinrishici.com/token 免费获取,替换掉 hook-0 里的那串。

  3. 不想要这个模块:把 [bar/mybar] 的 modules-left 里的 daily-poem 删掉即可,其它模块不受影响。

5.7 状态栏都有哪些模块(对照 A.2 看)

模块 类型 显示内容 备注
date internal/date 日期时间
i3 internal/i3 工作区
title internal/xwindow 当前窗口标题
daily-poem custom/script 今日诗词 见 5.6,可关
cpu internal/cpu CPU xx%
memory internal/memory Mem xx% 曾加过渐变条,为省空间去掉了
temperature internal/temperature 温度 虚拟机可能显示 N/A
wired-network custom/script 多网卡 IP netinfo.sh ip
eth-upload/down custom/script 上下行合计网速 netinfo.sh up/down
pulseaudio internal/pulseaudio 音量/静音 滚轮可调,需 pulseaudio-utils
backlight internal/backlight 亮度 虚拟机无背光,可能不显示
battery internal/battery 电池 台式机/虚拟机不显示
system-usb-udev custom/script U 盘插拔 需 jq

5.8 启动与排障

bash 复制代码
# 前台启动看报错(最有用的一步)
DISPLAY=:0 polybar mybar -l info

# 后台启动(i3 自启里调的就是这个)
~/.config/polybar/launch.sh

# 重启状态栏
killall polybar; sleep 1; ~/.config/polybar/launch.sh

坑 6b :通过 SSH 远程重启 polybar 必须带 DISPLAY=:0,

否则报 Can't parse display string 直接退出。


第 6 步:rofi 启动器

6.0 文件与依赖

  • 配置文件只有一个 :~/.config/rofi/config.rasi(附录 A.5,147 行)
  • 依赖:rofi(2.0 及以上)、字体 Fira Code、图标主题(papirus-icon-theme)
  • 键位:Alt+d(见 A.1 的 bindsym $mod+d)
bash 复制代码
mkdir -p ~/.config/rofi
nano ~/.config/rofi/config.rasi     # 粘贴附录 A.5 全文
rofi -show drun -theme ~/.config/rofi/config.rasi -show-icons   # 直接试

配置文件 ~/.config/rofi/config.rasi,网上主题很多(Base16 Material 等),但有几个大坑:

6.1 坑 7:rofi 2.0 不再自动加载 config.rasi!

这是"启动器看不清/主题不生效"的最大元凶 。rofi 1.x 会自动加载

~/.config/rofi/config.rasi,但 rofi 2.0 不会 ------无论你在里面写什么主题,

启动出来永远是 rofi 自带默认主题(蓝色高亮、窄窗口)。

解决:启动命令必须显式指定主题路径:

复制代码
bindsym $mod+d exec --no-startup-id rofi -show drun -theme ~/.config/rofi/config.rasi -show-icons

验证主题是否被加载:

bash 复制代码
rofi -dump-theme | grep -i "你的主题特征色"     # 有输出 = 加载成功
rofi -v                                        # 先确认版本

6.2 坑 8:rofi 的 8 位 hex 是 #AARRGGBB(透明度在前!)

rasi 复制代码
window {
        transparency: "real";
        /* 错误写法:#263238CC 会被解析成透明度 0x26 ≈ 15%,面板几乎全透明 */
        /* rgba() 写法虽比 8 位 hex 稳,但在 rofi 2.0 上仍可能出现"视觉上发透"的观感 */
        background-color: rgba ( 38, 50, 56, 96 % );
}

网上抄来的主题很多踩这个坑,表现为"面板看不清、文字和壁纸混在一起"。

最稳的做法:面板背景直接用 6 位实心色,不用任何透明度------

rasi 复制代码
window {
        transparency: "real";
        background-color: #141A20;   /* 实心深色,绝无透底 */
}

验证是否真的不透明(像素级):打开 rofi 后分别抓「窗口自身缓冲区」和「全屏」,同一位置采样应完全一致:

bash 复制代码
WID=$(xdotool search --name "^rofi" | head -1)
import -window "$WID" /tmp/win.png; import -window root /tmp/root.png
convert /tmp/win.png  -crop 1x1+380+300 -depth 8 txt:   # 如 #141A20
convert /tmp/root.png -crop 1x1+959+429 -depth 8 txt:   # 应为同一颜色

6.3 坑 9:主题字体要确认已安装

主题常写 font: "Roboto Mono 13",没装这个字体的话 rofi 会静默回退到文泉驿正黑,

显示又小又糊。用 fc-match "Roboto Mono" 查回退到了谁。本机装了 Fira Code 就写:

rasi 复制代码
font: "Fira Code 14";

6.4 图标

启动命令加 -show-icons:

复制代码
bindsym $mod+d exec --no-startup-id rofi -show drun -theme ~/.config/rofi/config.rasi -show-icons

6.5 最终采用的配色:Nord 柔和高对比

经过多轮"看不清/不舒服"的调优,最终定稿为 Nord 配色------实心深底 + 柔和高对比:

rasi 复制代码
* {
    bg: #2E3440;        /* nord1 深蓝灰底(实心,无透明) */
    bg-alt: #3B4252;    /* nord2 选中行底色 */
    fg: #ECEFF4;        /* nord6 主文字,明亮清晰 */
    fg-dim: #D8DEE9;    /* nord4 次要文字 */
    accent: #88C0D0;    /* nord8 选中文字/高亮,冰蓝 */
    border: #4C566A;    /* nord10 边框 */

    background-color: @bg;
    text-color: @fg;
    font: "Fira Code 13";
}

window {
    width: 750px;
    border: 2px;
    border-color: @border;
    border-radius: 10px;
    background-color: @bg;      /* 实心,绝不透底 */
}

element selected {
    background-color: @bg-alt;
    text-color: @accent;
}

配色心得 :与其追求"毛玻璃透明感"(在 rofi 2.0 上各种坑),不如用

Nord 这类"深底 + 冰蓝高亮"的实心方案------既柔和又绝不看不清。



第 7 步:konsole 终端

终端的样子由 konsole 自己的 profile 决定,跟 i3 配置无关。分三个层次:

层次 文件 管什么 全文
主配置 ~/.config/konsolerc 默认用哪个 profile、菜单栏隐藏、书签 附录 A.6
工具栏字体 ~/.config/kdeglobals konsole 上方工具条的字号 附录 A.6b
字体/字号/配色 ~/.local/share/konsole/Profile 2.profile + *.colorscheme Fira Code Retina 12 号、Kali-Dark 配色 附录 A.7 / A.7b~e

推荐 profile 设置:Fira Code Retina 12 号 + Kali-Dark 配色 + MenuBar=Disabled + 隐藏滚动条 + 无限回滚。

7.1 建文件

bash 复制代码
mkdir -p ~/.local/share/konsole
# 按附录 A.6 / A.6b / A.7 / A.7b~e 建好对应文件(纯文本,直接粘贴保存)
konsole &          # 打开看字体、配色、菜单栏对不对

名字必须对上 :konsolerc 里 DefaultProfile=Profile 2.profile,

所以 ~/.local/share/konsole/ 下必须真有一个叫 Profile 2.profile 的文件;

配色方案 ColorScheme=Kali-Dark 也要求 Kali-Dark.colorscheme 存在。

想做减法的话,最简单的做法是:先建一个 profile,再在 konsole 界面里选它当默认 ,

让 konsole 自己去写 konsolerc,比手改不容易错。

7.2 图形界面改法(等价操作)

konsole → 设置 → 编辑当前配置文件 → 外观(配色)/ 字体(Fira Code Retina,12 号)。

在界面里改完会自动写回上面这些文件,两种方式效果一样。

工具栏("标题栏")那行字不归 profile 管,在 ~/.config/kdeglobals 的

[General] toolBarFont=Noto Sans,9,... 里(附录 A.6b)。想让工具条更小就改这个字号。


第 8 步:zsh + powerlevel10k

8.0 顺序(别打乱)

  1. 装包(第 1 步已含 zsh zsh-autosuggestions zsh-syntax-highlighting lolcat git curl)
  2. 先装 zim 框架(powerlevel10k 主题在里面)
  3. 再放 ~/.zshrc / ~/.zimrc / ~/.p10k.zsh 三个文件(附录 A.8 / A.8b / A.8c)
  4. 把 zsh 设为登录 shell
  5. 开新终端验证
bash 复制代码
# ② 装 zim(powerlevel10k 主题包含在内)
curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh

# ③ 放本文的三个文件,并把里面的 /home/sirius 换成本机家目录
#    (.zshrc / .zimrc / .p10k.zsh 见附录 A.8 / A.8b / A.8c)
sed -i "s|/home/sirius|$HOME|g" ~/.zshrc ~/.zimrc ~/.p10k.zsh

# ④ 设为默认 shell(重新登录生效)
chsh -s "$(which zsh)"

8.1 提示符的两个常见问题

① 右侧出现一长串 ✓ user@主机名

那是右侧提示符里的 context 段。在 ~/.p10k.zsh 的

POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS 列表里把 context 那行注释掉,开新终端生效。

② 图标变成方块/问号

p10k 的图标依赖 Nerd Font:

bash 复制代码
mkdir -p ~/.local/share/fonts
# 下载 MesloLGS NF 四个 ttf(p10k 官方推荐)后:
cp MesloLGS*.ttf ~/.local/share/fonts/ && fc-cache -f ~/.local/share/fonts
# 然后 konsole → 设置 → 编辑当前配置文件 → 字体改为 "MesloLGS NF"

不想折腾字体也行:跑 p10k configure 选 ASCII/无图标样式,重新生成一份 ~/.p10k.zsh。


第 9 步:壁纸与登录

9.1 设壁纸

bash 复制代码
# 把壁纸放到统一位置(第 2 步已建好目录)
cp 你的壁纸.jpg ~/Pictures/wallpapers/wall.jpg

# 用 feh 设置,并让它写入 ~/.fehbg(下次登录自动恢复)
feh --bg-fill ~/Pictures/wallpapers/wall.jpg

# 确认生成了自启脚本
cat ~/.fehbg

i3 配置里已有 exec_always feh --randomize --bg-fill ...(见 3.5 改路径),

所以每次登录都会重设一次壁纸------两条路任选其一,都行,但路径要对。

9.2 登录默认进 i3(保留 Xfce 备用)

bash 复制代码
# ① 确认 i3 会话已注册
ls /usr/share/xsessions/          # 应能看到 i3.desktop

# ② 把默认会话设成 i3(不用改 lightdm 全局配置)
printf "[Desktop]\nSession=i3\n" > ~/.dmrc

注销后默认进 i3。想临时回 Xfce:在登录界面输入密码前,点右上角/齿轮图标切换会话。


第 10 步:重启验收与排障

10.1 重启前自检

bash 复制代码
# 1) i3 语法
i3 -C -c ~/.config/i3/config && echo "i3 OK"

# 2) 脚本可执行位
ls -l ~/.config/i3/scripts/*.sh ~/.config/polybar/*.sh ~/.config/polybar/scripts/*.sh

# 3) 检查示例路径是否都已替换(应该没有输出)
grep -rn "/home/sirius" ~/.config ~/.zshrc ~/.zimrc ~/.p10k.zsh ~/.fehbg 2>/dev/null

# 4) 关键字体
fc-match "Font Awesome 5 Free Solid"; fc-match "Symbola"; fc-match "Fira Code"

10.2 逐项验收(重启登录后照着打勾)

# 检查什么 怎么做 正常表现
1 进到 i3 了吗 登录后看顶部 有状态栏,无 Xfce 面板
2 壁纸 看桌面 你设的那张图
3 状态栏起来了 pgrep -a polybar 有 polybar mybar 进程
4 工作区 Alt+1 / Alt+2 左上角数字变化
5 终端 Alt+Enter 弹出 konsole,Fira Code 字体
6 启动器 Alt+d rofi 深蓝面板 + 图标
7 提示符 新开终端 分段提示符(不是 $)
8 CPU/内存 看状态栏 有百分比在动
9 网卡 IP 看状态栏 🌐 eth0:192.168.x.x
10 网速 下点东西 ↑↓ 数值跳动
11 音量键 按音量+/− 数字变化,最大 100%
12 静音 按键盘静音键(XF86AudioMute) 状态栏显示"静音"
13 锁屏 Alt+l 模糊背景 + 大时钟 + 圆环
14 解锁 输密码回车 回到桌面
15 通知 notify-send 测试 右上角弹窗
16 截图 scrot ~/t.png 生成图片文件
17 剪贴板 pgrep -a copyq / 托盘图标 有 copyq 进程与图标
18 自动锁屏 等 10 分钟 自动锁(xautolock)
19 浏览器 Alt+Shift+g Chrome 打开(装了的)
20 注销/关机 Alt+Shift+Ctrl+q 弹出 l/e/r/o 菜单

哪一项不对,直接跳到 排错手册 对号入座。

10.3 无头冒烟测试(不敢直接注销时用)

在 SSH 里也能验证"桌面能不能起来",不影响你当前的图形会话:

bash 复制代码
cat > /tmp/smoke.sh <<'EOF'
#!/bin/bash
export DISPLAY=:99
pkill -f "Xvfb :99"; sleep 1
Xvfb :99 -screen 0 1920x1080x24 &
sleep 2
i3 -c ~/.config/i3/config &
sleep 4
konsole -e zsh &
sleep 6
import -window root /tmp/i3test.png
killall konsole i3 polybar feh dunst xcompmgr 2>/dev/null
pkill -f "Xvfb :99"
EOF
chmod +x /tmp/smoke.sh && /tmp/smoke.sh

把 /tmp/i3test.png 拿回本地看:壁纸、状态栏、终端一目了然。

坑 9 :测试 zsh 提示符必须用交互式 zsh(konsole -e zsh),

zsh -c "..." 不加载 .zshrc,提示符不会渲染。
坑 10 :polybar 的温度/电池/背光/无线模块在没有对应硬件的虚拟机里会自动禁用,

日志里有 warning 属正常。

10.4 起不来 / 黑屏 / 只有鼠标怎么办

现象 先查这个
登录后一片黑,只有鼠标 i3 配置语法错 → i3 -C -c ~/.config/i3/config
桌面起了但顶栏没有 DISPLAY=:0 polybar mybar -l info 看报错
顶栏有但图标全方块 字体族名不对 → 第 2 步 2.3
终端一闪就退 .zshrc 里某条命令失败 → `zsh -x -c exit 2>&1
所有快捷键都没反应 修饰键不是 Alt(set $mod Mod1),或 i3 没加载新配置
音量键无反应 没装 pulseaudio-utils(坑 17)
Alt+l 没反应 i3lockr 不存在或没 chmod(坑 18)

日志位置:

bash 复制代码
~/.local/share/xorg/Xorg.0.log     # X 层
journalctl -b -p err               # 本次启动的所有错误
~/.xsession-errors                 # 会话级报错(部分系统有)

排错手册(坑 1~19)

# 现象 原因 解决
1 apt 下载卡住 镜像 IPv6 不通 加 -o Acquire::ForceIPv4=true
2 nitrogen 装不上 新版 Kali 已移除 壁纸用 feh,认证用 lxpolkit
3 neofetch 不存在 已移除 用 fastfetch
4 i3 边框变亮绿色 client 颜色只写 4 位,child_border 回退 5 个颜色位全部显式写
5 内存总量显示错误 教程写死 /16GiB 用 %gb_total% 动态取值
6 🐏🌐 图标巨大 Noto Color Emoji 位图不缩放 装 fonts-symbola 排前面
7 rofi 主题不生效 rofi 2.0 不自动加载 config.rasi 启动命令加 -theme ~/.config/rofi/config.rasi
8 rofi 字体又小又糊 主题字体未安装,静默回退 换成已装字体并 fc-match 验证
9 提示符测试不显示 zsh -c 非交互不加载 .zshrc 用交互式 zsh 测试
10 提示符右侧长串 p10k context 段 注释 RIGHT_PROMPT_ELEMENTS 里 context
11 scp 文件互相覆盖 同名文件 改名或分次传输
12 rofi 面板全透明 8 位 hex 被按 #AARRGGBB 解析 用 rgba ( r, g, b, N % ) 或实心色
13 断一块网卡显示"未连接" polybar interface 写死 eth0 改用 netinfo.sh 脚本模块自动检测(见 5.3)
14 SSH 重启 polybar 失败 缺 DISPLAY 环境变量 export DISPLAY=:0 后再启动
15 ne 命令不存在 旧 alias 引用已移除的 neofetch 改成 `alias ne="fastfetch
16 快捷键进入某模式没反应 mode "$变量" 但变量没 set 定义(空模式) 先 set $mode_system System (l) lock, (e) exit, (r) reboot, (o) shutdown 再绑定
17 音量键/调音量没反应 i3 默认绑定调 pactl,但 pulseaudio-utils 没装 sudo apt install pulseaudio-utils;键盘音量键、顶栏 🔊 滚轮、pactl set-sink-volume @DEFAULT_SINK@ +10% 均可
18 锁屏(mod+l / 自动锁屏)没反应 i3lockr 不在 Kali 仓库,需要自建;且 i3lock-fancy 在 ImageMagick 7 下字体解析有 bug(convert 报 unable to load font 后直接退出) sudo apt install scrot,建 /usr/local/bin/i3lockr 替身:scrot -z 截屏 → convert 高斯模糊 + 暗化 + 提示文字 → i3lock-color 常显时钟 + 常显大圆环 + 中文验证提示(v10 完整脚本见下)
19 状态栏音量显示 2350% 之类的天文数字 pactl set-sink-volume +10% 允许超过 100%,按住音量+键自动重复就一路加到几千 %;超过 100% 会严重削波失真 加音量改用带 100% 上限的脚本 ~/.config/i3/scripts/volup.sh(完整脚本见下),i3 绑定改为调用脚本

坑 18 的完整替身脚本 v10(逐行注释版) ------/usr/local/bin/i3lockr

效果:模糊暗化背景 + 常显大字时钟(每秒刷新)+ 常显 Nord 青色圆环 + 中文"验证中/密码错误"提示;输密码变亮、退格变黄、输错变红。

第一步,安装 i3lock-color(每条命令的作用):

sh 复制代码
# 从 Kali 官方镜像下载 deb 包(东软镜像 DNS 抽风时的绕法)
#   -f  下载失败时报错返回非 0(不把错误页存成文件)
#   -s  静默模式(不显示进度条)
#   -S  配合 -s,出错时仍然把错误打到 stderr
#   -L  跟随重定向(http.kali.org 是个跳转服务,会 302 到真实镜像)
curl -fsSL -o /tmp/i3lock-color.deb "http://http.kali.org/kali/pool/main/i/i3lock-color/i3lock-color_2.13.c.5-0kali1_amd64.deb"

# 只解包、不安装:dpkg-deb -x 把包里的文件释放到指定目录
# 不走 dpkg -i 是因为 i3lock-color 与已装的 i3lock 包冲突(Conflicts),
# 解包方式完全不动系统包数据库,最干净
sudo dpkg-deb -x /tmp/i3lock-color.deb /tmp/i3lc

# 包里的二进制叫 i3lock,复制出来改名 i3lock-color,放到 /usr/local/bin(在 PATH 里,且不覆盖系统的 /usr/bin/i3lock)
sudo cp /tmp/i3lc/usr/bin/i3lock /usr/local/bin/i3lock-color

# 加执行权限并清理临时文件
sudo chmod +x /usr/local/bin/i3lock-color && rm -rf /tmp/i3lc /tmp/i3lock-color.deb

密码验证走 PAM,用的是系统 i3lock 已有的 /etc/pam.d/i3lock,所以解包安装不需要额外配置认证。

第二步,创建 /usr/local/bin/i3lockr(chmod +x)。全文每一段、每个参数都有注释:

bash 复制代码
#!/bin/bash
# ============================================================
# i3lockr 替身 v10 ------ 锁屏美化脚本
# 流程:截屏 → 高斯模糊 → 暗化 → 叠加提示文字 → i3lock-color 上锁
# 效果:模糊暗化背景 + 常显大字时钟(每秒刷新) + 常显 Nord 青色圆环
#       + 中文"验证中/密码错误"提示;输密码变亮、退格变黄、输错变红
# ============================================================

# --- ① 选定锁屏程序 -----------------------------------------
# 优先用 i3lock-color(支持时钟/圆环配色),没装则退回系统 i3lock(少美化但功能不缺)
LOCK=/usr/local/bin/i3lock-color
command -v $LOCK >/dev/null 2>&1 || LOCK=i3lock

# --- ② 生成唯一临时文件路径 ----------------------------------
# mktemp 生成 /tmp/lock.XXXXXX 形式的随机名,后面补 .png 后缀;
# 用随机名避免多用户/多次锁屏互相覆盖
IMG=$(mktemp /tmp/lock.XXXXXX).png

# --- ③ 截取当前屏幕 ------------------------------------------
# scrot -z:-z 表示等屏幕空闲再截(避免截到残影)
# 截屏失败(如无 X 权限)就退化为纯黑锁屏,保证功能不中断
scrot -z "$IMG" || { $LOCK -c 000000 -e; exit 0; }

# --- ④ 准备字体和分辨率 ---------------------------------------
# 中文用文泉驿微米黑(Kali 自带);换字体改这一行即可
FONT=/usr/share/fonts/truetype/wqy/wqy-microhei.ttc
# identify(ImageMagick) 取截图分辨率,格式 "宽x高";取不到就按 1920x1080 兜底
SIZE=$(identify -format "%wx%h" "$IMG" 2>/dev/null) || SIZE=1920x1080
# 把 "1918x878" 拆成 W=1918、H=878(%x* 截掉 x 之后的内容,#*x 截掉 x 之前的内容)
W=${SIZE%x*}; H=${SIZE#*x}

# --- ⑤ 高斯模糊背景 -------------------------------------------
# 原理:先缩小到 20%(细节自然糊掉)再放大回原尺寸,比直接大半径模糊快得多
convert "$IMG" \
  -filter Gaussian \
  -resize 20% \
  -define filter:sigma=1.5 \
  -resize 500.5% \
  -level 0%,100%,0.6 \
  "$IMG" || true
#  ↑ 参数解释:
#    -filter Gaussian         用高斯滤波器(比默认滤波更柔和自然)
#    -resize 20%              缩小到 20%,细节在这一步糊掉
#    -define filter:sigma=1.5 缩放时的高斯强度 1.5
#    -resize 500.5%           放大回原尺寸(500.5% 是 i3lock-fancy 的祖传写法)
#    -level 0%,100%,0.6       轻微压对比度,让后面的文字更突出
#    || true                  就算失败也不中断脚本

# --- ⑥ 暗化 + 叠加静态提示文字 ----------------------------------
# 只把"输入密码解锁"烤进图里(它永远不变);
# 时间/日期是会走的,必须交给 i3lock-color 实时画,不能烤进静态图!
convert "$IMG" \
  -fill black -colorize 35% \
  -font "$FONT" \
  -pointsize $((H/36)) \
  -fill "#DDDDDD" \
  -gravity center \
  -annotate +0+$((H/5)) "输入密码解锁" \
  "$IMG" || true
#  ↑ 参数解释:
#    -fill black -colorize 35%   整体压暗 35%(数字越大越暗),突出前景
#    -font "$FONT"               后面文字用文泉驿微米黑
#    -pointsize $((H/36))        字号随屏幕高度自适应(878px 屏 ≈ 24px)
#    -fill "#DDDDDD"             文字颜色浅灰
#    -gravity center             坐标系以屏幕中心为原点
#    -annotate +0+H/5 "文字"     在中心下方 H/5(≈175px)处画字

# --- ⑦ 组装 i3lock-color 参数(用数组才能每行带注释) ------------
ARGS=(
  # 显示控制:
  --indicator                    # 圆环常显(默认要按键盘才出现,缺了锁屏是空白)
  --force-clock                  # 时钟常显(默认显示提示文字时会把时钟藏起来)
  # 圆环形状:
  --radius=$((H/11))             # 圆环半径,随分辨率自适应(878px 屏 ≈ 80px)
  --ring-width=8                 # 圆环线条粗细(像素)
  # 圆环配色(8 位 RRGGBBAA,最后两位是透明度 FF=不透明):
  --inside-color=00000055        # 环内填充:黑色半透明
  --ring-color=88C0D0FF          # 平时圆环:Nord 青
  --insidever-color=88C0D088     # 正在验证时环内:青半透明
  --ringver-color=A3E7FCFF       # 正在验证时圆环:亮青
  --insidewrong-color=BF616A88   # 密码错误时环内:红半透明
  --ringwrong-color=BF616AFF     # 密码错误时圆环:正红
  --keyhl-color=88C0D0CC         # 输密码时环内小点亮起:青
  --bshl-color=EBCB8BCC          # 按退格键时小点亮起:黄
  --separator-color=00000000     # 分隔线:全透明(隐藏)
  --line-color=00000000          # 失败计数横线:全透明(隐藏)
  # 验证/错误提示文字(中文):
  --verif-text="验证中"           # 正在验证时显示的字(不要带省略号,会光学偏左)
  --wrong-text="密码错误"         # 密码错误时显示的字
  --verif-color=FFFFFFFF         # 提示文字颜色:白
  --wrong-color=FFFFFFFF
  --verif-size=$((H/32))         # 提示字号(878px 屏 ≈ 27px)
  --wrong-size=$((H/32))
  --verif-font="WenQuanYi Micro Hei"   # 中文字体(fontconfig 名称)
  --wrong-font="WenQuanYi Micro Hei"
  # 实时时钟(每秒刷新;这些字会变,所以不能烤进背景图):
  --clock                        # 开启时钟
  --time-str="%H:%M"             # 时间格式:时:分(strftime 语法)
  --time-pos="x+w/2:y+h/2-240"   # 位置:水平中点、屏幕中心上方 240px
  --time-size=$((H/10))          # 时间字号(878px 屏 ≈ 87px,大字)
  --time-font="WenQuanYi Micro Hei"
  --time-color=FFFFFFFF          # 时间颜色:白
  --date-str="%Y年%m月%d日 %A"   # 日期格式:%A 按系统语言显示"星期日"
  --date-pos="x+w/2:y+h/2-130"   # 位置:水平中点、屏幕中心上方 130px
  --date-size=$((H/32))          # 日期字号(≈ 27px)
  --date-font="WenQuanYi Micro Hei"
  --date-color=FFFFFFFF          # 日期颜色:白
)
# 注意:--time-pos/--date-pos 不支持负数写法!写 "0:-219" 时间会整个不渲染。
#       必须用变量表达式:x/y=屏幕左上角坐标 w/h=分辨率 r=圆环半径
#       例如 "x+w/2:y+h/2-240" = 水平居中、垂直中心上方 240px

# --- ⑧ 上锁 ---------------------------------------------------
# -i 指定背景图;-e 忽略空密码(直接回车不解锁)
# 故意不用 -f/--show-failed-attempts:失败次数数字在这版里位置固定、不对齐圆心
$LOCK -i "$IMG" -e "${ARGS[@]}"

# --- ⑨ 清理临时截图 -------------------------------------------
rm -f "$IMG"

脚本里的三个关键坑 (配不好时先查这三条):

① i3lock-color 的圆环默认只在按键盘后才显示 ,时钟跟着指示器走------不加

--indicator + --force-clock,锁屏画面就是一片空白;

② --time-pos 不支持负数偏移 ,写 0:-219 时间会整个不渲染,必须用

x+w/2:y+h/2-240 这种变量表达式;

③ 不用 -f 显示失败次数------这版 fork 里那个数字位置固定、不对齐圆心。

为什么时间不能用 ImageMagick 写进背景图 :背景图是锁屏瞬间生成的静态 PNG,

写进去就永远停在那个时刻,所以会变的时间/日期必须交给 --force-clock 实时绘制。

调参速查 :暗化程度改 -colorize 35%;圆环大小改 --radius=$((H/11)) 分母;

时间/日期位置改 --time-pos/--date-pos 的 y 减数(240/130);字号改

--time-size/--date-size;提示文字内容改 --verif-text/--wrong-text。

测试锁屏的教训 :i3lock 会忽略 SIGTERM (防绕过设计),不要用 timeout

远程试锁------锁上就解不开,只能 sudo pkill -9 i3lock 救援。验证参数合法性

的安全方法:DISPLAY="" 命令... 空跑,报 "Could not connect to X11" 说明参数全部通过。

解锁方式:输入登录密码回车;圆环变红 = 密码不对。

坑 19 的音量上限脚本(逐行注释版):

~/.config/i3/scripts/volup.sh(chmod +x)------步进 10%,封顶 100%:

sh 复制代码
#!/bin/sh
# ============================================================
# volup.sh ------ 加大音量:步进 10%,封顶 100%
# 为什么封顶:pactl 允许音量超过 100%(按住键能冲到几千 %),
# 超过 100% 是硬放大信号,会削波失真还伤耳朵
# ============================================================

# pactl 要和当前用户的 PulseAudio 服务通信,
# 从脚本/SSH 调用时没有这个环境变量会报错,手动指明运行时目录
export XDG_RUNTIME_DIR=/run/user/$(id -u)

# 读取当前音量数值。pactl 的输出长这样:
#   Volume: front-left: 32768 /  50% / -18.06 dB,   front-right: ...
#   head -1            取第一行(丢弃 balance 行)
#   grep -o "[0-9]*%"  抠出 "50%" 这样的百分比片段(第一个=左声道)
#   tr -d "%"          去掉百分号,得到纯数字 50
V=$(pactl get-sink-volume @DEFAULT_SINK@ | head -1 | grep -o "[0-9]*%" | head -1 | tr -d "%")

# 读不到音量(服务没响应等)就直接退出,不做任何操作
[ -z "$V" ] && exit 0

# 91% 以上再加 10% 会冲过 100%,直接精确设到 100% 封顶
if [ "$V" -ge 91 ]; then
  pactl set-sink-volume @DEFAULT_SINK@ 100%
else
  # 正常情况:步进 +10%
  pactl set-sink-volume @DEFAULT_SINK@ +10%
fi

~/.config/i3/scripts/voldown.sh(chmod +x)------降低音量(0% 是天然下限,无需保护):

sh 复制代码
#!/bin/sh
# ============================================================
# voldown.sh ------ 降低音量:步进 10%
# 0% 是天然下限,不需要保护逻辑
# ============================================================

# 同 volup.sh:脚本环境需要手动指明 PulseAudio 运行时目录
export XDG_RUNTIME_DIR=/run/user/$(id -u)

# @DEFAULT_SINK@ = 当前默认输出设备(扬声器/耳机自动跟随)
pactl set-sink-volume @DEFAULT_SINK@ -10%

i3 绑定相应改为(--no-startup-id 告诉 i3 这不是启动器程序、不用显示启动沙漏光标):

i3 复制代码
bindsym XF86AudioRaiseVolume exec --no-startup-id ~/.config/i3/scripts/volup.sh
bindsym XF86AudioLowerVolume exec --no-startup-id ~/.config/i3/scripts/voldown.sh

如果音量已经冲到几百上千 %,直接 pactl set-sink-volume @DEFAULT_SINK@ 50% 拉回来即可。


日常使用速查($mod = Alt)

快捷键 功能
Alt+Enter 打开终端
Alt+d rofi 启动器
Alt+Shift+a 程序启动器(备用键位)
Alt+m / Alt+Shift+m 启动 / 关闭状态栏
Alt+Shift+c / Alt+Shift+r 重载配置 / 重启 i3
Alt+1..9 切换工作区
Alt+Shift+1..9 窗口移到工作区
Alt+h/j/k/l 方向键 切换焦点窗口
Alt+v / Alt+h(布局) 垂直 / 水平分割
Alt+f 全屏
Alt+Shift+q 关闭窗口
Alt+Shift+Ctrl+q → l/e/r/o 锁屏 / 退出 / 重启 / 关机
Alt+z / Alt+Shift+g 文件管理器 / 浏览器

改完任何配置:i3 配置用 Alt+Shift+c 重载;polybar 用 Alt+Shift+m 再 Alt+m;

zsh/p10k 开新终端;rofi 每次启动自动读最新配置。


可选:Sirius 工具箱(第三方工具启动面板)

本章不影响桌面本身,只是把一个多工具图形启动面板接到 i3 上。不需要就整章跳过。

工具箱本体在 ~/.linux版/,结构如下:

复制代码
~/.linux版/
├── cs2.py          # ttkbootstrap 图形启动器(工具按钮都在这里注册)
├── config.py       # 每个工具的启动命令定义
├── start.sh        # 工具箱启动入口
├── img/            # 工具图标(png)
└── storage/        # 所有工具的存放地(每个工具一个目录)
    ├── afrog/
    ├── ARDM/
    ├── shiro_attack/
    └── ...

14.1 添加新工具(接入 GUI 界面,3 步)

假设要加一个叫 MyTool 的新工具:

第 1 步:把工具放进 storage

复制代码
~/.linux版/storage/MyTool/
├── 工具本体
└── linux_start.sh    # 启动脚本(惯例命名)

linux_start.sh 模板(记得 chmod +x):

bash 复制代码
#!/bin/bash
current_dir=$(dirname "$0")
cd $current_dir
konsole -e bash -c './你的命令 ; exec /bin/zsh'   # 终端类工具(要包 konsole 才能看到输出)
# 或
./程序名                                          # GUI 程序(如 java -jar xx.jar)

第 2 步:config.py 里加启动函数

python 复制代码
def MyTool():
    subprocess.Popen(f"{DOWNLOAD_THE_CURRENT_DIRECTORY}MyTool/linux_start.sh", shell=True)

第 3 步:cs2.py 里注册按钮(照抄现有工具的代码块格式):

python 复制代码
# ------------------------------MyTool---------------------------------
position = [2, 3]                    # 分类面板里的位置(行,列),别和现有工具重叠
Tool_Introduction = """工具功能简介(鼠标悬停显示)"""
Tool_Name = "MyTool"
Updatecheck = "v1.0版本"
run = config.MyTool                  # 对应 config.py 里的函数名
MyImage = ImageTk.PhotoImage(Image.open(f"./img/MyTool.png").resize((SIZE, SIZE)))
Whether_to_download_or_not().mian(Frame_Information_collection_class, Tool_Name,
                                  Tool_Introduction, Updatecheck, MyImage, run, position)

注意最后的 Frame_XXX_class 参数决定按钮出现在哪个分类页(信息收集/漏洞利用等),

抄哪个现有工具的块就落在哪个分类里。

三个易踩的坑:

  1. 图标必须存在 :img/MyTool.png 没有就启动器崩溃------找一张 png 放进去,或借用工具目录里自带的图标
  2. position 别与现有工具重叠,否则按钮叠在一起
  3. 终端类工具必须 konsole -e 包一层,否则双击启动后后台运行、看不到输出

14.2 最简方式(不改代码)

工具丢进 storage/ 后不接 GUI,用时终端里:

bash 复制代码
cd ~/.linux版/storage/MyTool && ./linux_start.sh

14.3 更新已有工具

开源活跃工具(afrog / ARDM / shiro_attack / dirsearch 等)去 GitHub 下载最新

release 替换 storage/ 下对应目录即可,注意:

  • 启动脚本 linux_start.sh 里如果写死了 jar/AppImage 文件名 ,替换后要同步改
    | | |
    | --- | --- |
  • 字典类数据(如 shiro 的 key 字典)建议新旧合并去重 再覆盖:cat 旧 新 | sort -u > 合并
  • 闭源工具(LiqunKit、burp_loader、CS 系列)没有正规更新渠道,等上游发布
  • 替换前把旧版备份到 storage/_backup_old/,新版有问题随时回滚

14.4 已更新的版本记录(2026-11)

工具 版本
afrog 3.5.9(首次运行自动拉最新 PoC 库到 ~/.config/afrog/pocs)
ARDM(Redis 客户端) 1.7.4 AppImage
shiro_attack 5.1.1(zulu-8-jfx.jar,key 字典已合并 2317 条)
dirsearch 0.5.0(master 分支替换)

附录 A:完整配置文件全文

下面是每个文件的完整原件 ,与正文讲述的内容完全一致。

按下方表格把内容保存到对应路径即可,一字不改也能直接用。

daily-poem(今日诗词模块) :上游开源项目 https://github.com/Yucklys/polybar-daily-poem

(Rust 编译的二进制)。它依赖 libssl.so.1.1,新版 Kali 只有 libssl3 会报错 ------

这就是它默认被注释掉的原因。解决办法:

① 从 Ubuntu 归档下载 libssl1.1 deb 并 dpkg -x 解包到

~/.config/polybar/scripts/libssl11/(不动系统包):

bash 复制代码
curl -sL -o /tmp/libssl11.deb http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.24_amd64.deb
mkdir -p ~/.config/polybar/scripts/libssl11
dpkg -x /tmp/libssl11.deb ~/.config/polybar/scripts/libssl11

② polybar config 里 hook 命令前加库路径前缀:

LD_LIBRARY_PATH=$HOME/.config/polybar/scripts/libssl11/usr/lib/x86_64-linux-gnu ~/.config/polybar/scripts/daily-poem ...

(A.2 的 polybar 全文里已是此写法)

token 到 https://v2.jinrishici.com/token 获取,hook-0 里替换即可。

文件 保存到(家目录下) 说明
.config/i3/config 同名 i3 主配置(含全部快捷键、mode_system 等 322 行完整版)
.config/polybar/config 同名 polybar 完整主配置(837 行,含全部模块)
.config/polybar/launch.sh 同名 启动脚本,记得 chmod +x
.config/polybar/scripts/ 同名 天气、USB 监控、hackspeed 脚本 + poem.txt(都要 chmod +x);daily-poem 二进制从 GitHub 下载(见上方说明)
.config/rofi/config.rasi 同名 rofi Nord 主题完整版(147 行)
.config/konsolerc 同名 konsole 主配置
.local/share/konsole/ 同名 konsole 全部 profile 和配色方案(含书签)
.zshrc / .zimrc 同名 zsh 配置(里面的 /home/sirius 要替换成你的用户名)
.p10k.zsh 同名 powerlevel10k 提示符完整配置(1826 行完整版见 A.8;也可以跑 p10k configure 重新生成一份)
.fehbg 同名 壁纸自启脚本(里面写死了壁纸路径,换壁纸后重新 feh --bg-scale 生成即可)
.dmrc 同名 默认会话 = i3
.config/i3/scripts/volup.sh / voldown.sh 同名 音量脚本(全文在第 4 步 4.2 / 4.3,记得 chmod +x)
/usr/local/bin/i3lockr 同绝对路径 锁屏脚本(全文在排错手册坑 18,记得 chmod +x)

保存后的检查清单:

bash 复制代码
# 1. 把示例用户名替换成你自己的用户名
grep -rln "/home/sirius" ~/.config ~/.zshrc ~/.zimrc ~/.p10k.zsh ~/.fehbg 2>/dev/null | \
  xargs -r sed -i "s|/home/sirius|$HOME|g"

# 2. 执行权限
chmod +x ~/.config/polybar/launch.sh ~/.config/polybar/scripts/*.sh

# 3. 校验并启动
i3 -C -c ~/.config/i3/config && echo 通过

提醒:以后改动桌面配置时,记得同步更新本附录里的对应全文,保持附录与实际文件一致。


下面是各文件的完整全文(A.1、A.2... 与上表一一对应):

A.1 i3 主配置(完整版)

.config/i3/config(322 行)

ini 复制代码
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#

# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!



set $mod Mod1


# #设置窗口边框等等
new_window pixel 2
new_float normal
hide_edge_borders both


#设置窗口间距
gaps inner 12
#gaps outer 6


# 窗户颜色
# 定义的参数,就和变量一样
set $bg-color 	         #2f343f  #$bg-color就定于#2f343f
set $inactive-bg-color   #2f343f
set $text-color          #f3f4f5
set $inactive-text-color #676E7D
set $urgent-bg-color     #E53935
set $focus-border        #2bcec2
set $inactive-border     #3b4252
# 窗口装饰
#                       边框              	背景         			 文本                指标               子边框(pixel模式实际显示)
client.focused          $focus-border         $bg-color         	$text-color          $focus-border      $focus-border
client.unfocused        $inactive-border      $inactive-bg-color 	$inactive-text-color $inactive-border   $inactive-border
client.focused_inactive $inactive-border      $inactive-bg-color 	$inactive-text-color $inactive-border   $inactive-border
client.urgent           $urgent-bg-color      $urgent-bg-color    	$text-color          $urgent-bg-color   $urgent-bg-color
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:Bitstream Vera Sans Mono 11

# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8

# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.

# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.

# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.

##==========================================自己配置 自启动=================================================================================================
# ======================================================================================================================================================
#exec --no-startup-id  mate-power-manager #电池托盘
exec --no-startup-id blueman-applet #蓝牙托盘
#exec --no-startup-id  variety #壁纸
exec --no-startup-id lxpolkit # 身份认证
# 设置vm
exec --no-startup-id vmware-user-suid-wrapper

# 自带锁屏
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lockr --blur 60 

# 启动utools 
exec --no-startup-id /usr/bin/utools 
 
exec_always feh --randomize --bg-fill 图片/壁纸/浏览器/20230827170427.jpg

# 剪切板管理
exec --no-startup-id copyq

exec --no-startup-id nm-applet

#启动polybar
exec --no-startup-id  ~/.config/polybar/launch.sh  

# 透明
exec --no-startup-id xcompmgr
#exec --no-startup-id /opt/apps/com.baidu.fcitx-baidupinyin/files/bin/bd-qimpanel.watchdog.sh # 启动百度输入法
exec --no-startup-id dunst  # dunst系统通知

# 无操作10分钟自动锁屏
exec --no-startup-id xautolock -time 10000 -locker i3lockr --blur 60
# ======================================================================================================================================================
# ======================================================================================================================================================

# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id ~/.config/i3/scripts/volup.sh
bindsym XF86AudioLowerVolume exec --no-startup-id ~/.config/i3/scripts/voldown.sh
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod



##====================================自己配置 快捷键==============================================
#bindsym $mod+n exec  --no-startup-id netease-cloud-music # 网易云音乐
bindsym $mod+Shift+g exec  google-chrome # 谷歌浏览器
bindsym $mod+z exec  nautilus # 文件管理器
bindsym $mod+Return exec  konsole #打开终端

bindsym $mod+l exec --no-startup-id i3lockr --blur 60 # 手动锁屏
bindsym $mod+d exec --no-startup-id rofi -show drun -theme ~/.config/rofi/config.rasi -show-icons

# 杀死 polybar
bindsym $mod+Shift+m exec killall polybar

# 启动polybar
bindsym $mod+m  exec  ~/.config/polybar/launch.sh  --shapes


# 壁纸设置
bindsym $mod+Ctrl+1  exec  feh --randomize --bg-fill ~/图片/壁纸/浏览器/16e97308c2e942a28c68afb22a36023b.jpg
bindsym $mod+Ctrl+2  exec  feh --randomize --bg-fill ~/图片/壁纸/浏览器/792a4b6934fc491b81342206e3192e59.png

bindsym $mod+Ctrl+3  exec  feh --randomize --bg-fill ~/图片/壁纸/20200605013054948.jpg.2560.1440.jpg
bindsym $mod+Ctrl+4  exec  feh --randomize --bg-fill ~/图片/壁纸/浏览器/21e8398470f1486583e548fe8db26d24.jpg
bindsym $mod+Ctrl+5  exec  feh --randomize --bg-fill ~/图片/壁纸/浏览器/4yxdxk.png
bindsym $mod+Ctrl+6  exec  feh --randomize --bg-fill ~/图片/壁纸/浏览器/5wxyp1.png
bindsym $mod+Ctrl+7  exec  feh --randomize --bg-fill ~/图片/壁纸/浏览器/43vvmv.jpg
bindsym $mod+Ctrl+8  exec  feh --randomize --bg-fill ~/图片/壁纸/浏览器/45d2y5.jpg
bindsym $mod+Ctrl+9  exec  feh --randomize --bg-fill ~/图片/壁纸/浏览器/20200509060837255.jpg
bindsym $mod+Ctrl+0  exec  feh --randomize --bg-fill ~/图片/2021-11-14_11-05.jpg

#---------显示标题栏---------
# 有边框和标题栏
bindsym $mod+n border normal   

# 无边框和标题栏
bindsym $mod+u border none    

# 1像素边框
bindsym $mod+o border pixel 3 

# 可在上面三种风格来回切换
bindsym $mod+b border toggle  
#---------------------------

#----------隐藏窗口----------
# 按$mod+-隐藏
bindsym $mod+minus move scratchpad  

#  按$mod+= 再现窗口
bindsym $mod+plus scratchpad show   
#---------------------------

bindsym $mod+Shift+a  exec xfce4-appfinder  # xfce程序启动器

# 将工作区移至下一个/上一个工作区并跟随
bindsym $mod+Ctrl+d   workspace next
bindsym $mod+Ctrl+s   workspace prev



# 关机 l锁屏 p关机 r重启 e退出i3
set $mode_system System (l) lock, (e) exit, (r) reboot, (o) shutdown
bindsym $mod+Shift+Ctrl+q mode "$mode_system"
mode "$mode_system" {
    bindsym l exec --no-startup-id i3lock -c '#000000', mode "default"
    bindsym e exec --no-startup-id i3-msg exit, mode "default"
    bindsym r exec --no-startup-id systemctl reboot, mode "default"
    bindsym o exec --no-startup-id systemctl poweroff, mode "default"
    bindsym Escape mode "default"
}
# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # Pressing left will shrink the window's width.
        # Pressing right will grow the window's width.
        # Pressing up will shrink the window's height.
        # Pressing down will grow the window's height.
        bindsym h resize grow width 1 px or 1 ppt
        bindsym l resize shrink width 1 px or 1 ppt
        bindsym j resize grow height 1 px or 1 ppt
        bindsym k resize shrink height 2 px or 1 rppt
        #bindsym semicolon resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 5 px or 5 ppt
        bindsym Down resize grow height 5 px or 5 ppt
        bindsym Up resize shrink height 5 px or 5 ppt
        bindsym Right resize grow width 5 px or 5 ppt

        # back to normal: Enter or Escape or $mod+r
        bindsym Return mode "default"
        bindsym Escape mode "default"
        bindsym $mod+r mode "default"
}
# ======================================================================================================================================================




# kill focused window
bindsym $mod+Shift+q kill

# start dmenu (a program launcher)

# A more modern dmenu replacement is rofi:
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
# There also is i3-dmenu-desktop which only displays applications shipping a
# .desktop file. It is a wrapper around dmenu, so you need that installed.
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop

# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
#bindsym $mod+l focus up
bindsym $mod+semicolon focus right

# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right

# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# split in horizontal orientation
bindsym $mod+h split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# focus the parent container
bindsym $mod+a focus parent

# focus the child container
#bindsym $mod+d focus child

# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"

# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10

# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"



bindsym $mod+r mode "resize"



# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
# bar {
#          status_command i3status
# }

A.2 polybar 主配置(完整版)

.config/polybar/config(837 行)

ini 复制代码
[colors]

; ;background = ${xrdb:color0:#222}
; background = #cc222222
; background-alt = #444
; ;foreground = ${xrdb:color7:#222}
; foreground = #b6a49b
; foreground-alt = #555
; primary = #ffb52a
; secondary = #e60053
; alert = #bd2c40

secondary = #e60053
nord7 = #8FBCBB
nord8 = #2bcec2
notice = #f1fa8c

;次配置颜色
success = #90EE90

;主配置颜色
warning = #EE6363

;#ff5555

background = #94222222
; 100  %	00
; 99   %	03
; 98   %	05
; 97   %	07
; 96   %	0A
; 95   %	0D
; 94   %	0F
; 93   %	12
; 92   %	14
; 91   %	17
; 90   %	1A
; 89   %	1C
; 88   %	1E
; 87   %	21
; 86   %	24
; 85   %	26
; 84   %	29
; 83   %	2B
; 82   %	2E
; 81   %	30
; 80   %	33
; 79   %	36
; 78   %	38
; 77   %	3B
; 76   %	3D
; 75   %	40
; 74   %	42
; 73   %	45
; 72   %	47
; 71   %	4A
; 70   %	4D
; 69   %	4F
; 68   %	52
; 67   %	54
; 66   %	57
; 65   %	59
; 64   %	5C
; 63   %	5E
; 62   %	61
; 61   %	63
; 60   %	66
; 59   %	69
; 58   %	6B
; 57   %	6E
; 56   %	70
; 55   %	73
; 54   %	75
; 53   %	78
; 52   %	7A
; 51   %	7D
; 50   %	80
; 49   %	82
; 48   %	85
; 47   %	87
; 46   %	8A
; 45   %	8C
; 44   %	8F
; 43   %	91
; 42   %	94
; 41   %	96
; 40   %	99
; 39   %	9C
; 38   %	9E
; 37   %	A1
; 36   %	A3
; 35   %	A6
; 34   %	A8
; 33   %	AB
; 32   %	AD
; 31   %	B0
; 30   %	B3
; 29   %	B5
; 28   %	B8
; 27   %	BA
; 26   %	BD
; 25   %	BF
; 24   %	C2
; 23   %	C4
; 22   %	C7
; 21   %	C9
; 20   %	CC
; 19   %	CF
; 18   %	D1
; 17   %	D4
; 16   %	D6
; 15   %	D9
; 14   %	DB
; 13   %	DE
; 12   %	E0
; 11   %	E3
; 10   %	E6
; 9   %	E8
; 8   %	EB
; 7   %	ED
; 6   %	F0
; 5   %	F2
; 4   %	F5
; 3   %	F7
; 2   %	FA
; 1   %	FC
; 0   %	FF



foreground = #ffffff
background-alt = #444
foreground-alt = #6272a4




[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false

[global/wm]
margin-top = 1
margin-bottom = 3


[bar/mybar]
;monitor = ${env:MONITOR:HDMI-1}
;width = 100% ;显示栏的长度
height = 28  ;显示栏的宽度

;offset-x = 1%
;offset-y = 1%
radius = 12
fixed-center = true

background = ${colors.background}
foreground = ${colors.foreground}

line-size = 4
line-color = #f00

border-size = 0 ;顶部的距离
border-color = #00000000

padding-left = 2
padding-right = 2

module-margin-left = 1
module-margin-right = 2

;进程管理器的大小
tray-maxsize = 27

; https://github.com/ryanoasis/nerd-fonts
; https://www.nerdfonts.com/cheat-sheet
font-0 = fixed:pixelsize=13;1
font-1 = unifont:fontformat=truetype:size=13:antialias=false;0
font-2 = Noto Sans Symbols2:style=Regular:size=13
font-3 = Font Awesome 5 Free Solid:size=13   ; 注意族名必须带 Solid,fc-match 实测 'Font Awesome 5 Free' 匹配不上
font-4 = Font Awesome 7 Brands:style=Regular:size=12
font-5 = DejaVu Sans:style=Bold:size=12
font-6 = Symbola:size=11
font-7 = Noto Color Emoji:size=10

; 朗读古寺
enable-ipc = true

; 最左面显示
modules-left = powermenu date  i3 title daily-poem 
; title==显示窗口的名
; daily-poem==日常读诗
; powermenu==关机操作
; menu-apps== 菜单
; menu-apps==i3 工作区


;modules-center = mpd

;中间显示
modules-center = 

               


;最右面显示
modules-right =   cpu    memory  temperature   wireless-network wired-network  eth-upload eth-download wlan-upload wlan-download   pulseaudio  backlight  battery  system-usb-udev  
            
            ;temperature==温度
            ;wireless-network=无线网络
            ;wired-network=有线网络
            ; eth-upload= eth网络的上传速、
            ; eth-download= eth网络的下载传速
            ; wlan-upload= wlan网络的上传速
            ; wlan-download = wlan网络的下载传速
            ;cpu=cpu
            ;memory=内存
            ;system-usb-udev==USB
            ;xkeyboard==键盘提示
            ;pulseaudio==音量
            ;backlight==屏幕亮度
            ;date==日期时间
            ;battery == 充电


# 托架
tray-position = right
tray-padding = 2
tray-background = ${colors.background}
transparent = true


 
cursor-click = pointer
cursor-scroll = ns-resize

;====================================


; ===菜单===
; https://github.com/polybar/polybar/wiki/Module:-menu
[module/menu-apps]
type = custom/menu

; 若为 true, <label-toggle> 将在左边,若为 false, 将在右边
expand-right = true

; menu-LEVEL-N 与 label-NAME 属性相同,并附加 exec 属性
; 命令将使用 /bin/sh -c $COMMAND

menu-0-0 = 浏览器
menu-0-0-exec = #menu-apps.open.1
menu-0-1 = 多媒体
menu-0-1-exec = #menu-apps.open.2

menu-1-0 =  Firefox
menu-1-0-exec = firefox
menu-1-1 =  Chromium
menu-1-1-exec = chromium

menu-2-0 = Gimp
menu-2-0-exec = gimp
menu-2-1 = Scrot
menu-2-1-exec = scrot

; <label-toggle> 可替换为 <label-(openclose)>
; 如果 expand-right 为 true ,则默认值为"<label-toggle><menu>"。注意,如果使用<label-toggle> 就必须定义 <label-open>
; format = <label-toggle> <menu>

label-open = 
label-close = 

; 分隔元件
label-separator = 


; ===i3 工作区===
; https://github.com/polybar/polybar/wiki/Module:-i3
[module/i3]
type = internal/i3
format = <label-state> <label-mode>

;下面横杆
format-underline = 	#FFFFF0

index-sort = true
wrapping-scroll = false

label-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.primary}

; 聚焦在显示器上的活动工作区
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2

; 任何显示器上的非活动工作区
label-unfocused = %index%
label-unfocused-padding = 2

; 未聚焦在显示器生的活动工作区
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}

; 设置紧急提示的工作区
label-urgent = %index%
label-urgent-background = ${colors.alert}
label-urgent-padding = 2

; 工作区之间的分隔符
; label-separator = 


; ===网络===
; https://github.com/polybar/polybar/wiki/Module:-network
; ===网络(自动检测有 IP 的网卡,支持双网卡切换)===
; https://github.com/polybar/polybar/wiki/Module:-script
[module/wired-network]
type = custom/script
exec = ~/.config/polybar/netinfo.sh ip
interval = 3.0
format-underline = #912CEE
label = %output%
label-foreground = ${colors.warning}

[module/wireless-network]
type = internal/network
interface = wlan0

interval = 3.0

; 间隔宽度
udspeed-minwidth = 3
; 所以端口累计
accumulate-stats = true
; 对未知状态的网络设备启用
unknown-as-up = true

format-connected =  <label-connected>

# 填充
;format-connected-padding = 2

;下面横杆
format-connected-underline = 	#912CEE


format-disconnected = <label-disconnected>

label-connected =   %essid% 
label-connected-foreground = ${colors.warning}



;label-disconnected = 


; label-disconnected = 
; label-disconnected-foreground = #66ffffff    

; ===eth0网速度===
; ===有线网速度(自动检测网卡)===
[module/eth-upload]
type = custom/script
exec = ~/.config/polybar/netinfo.sh up
interval = 3.0
format-underline = #FFE4E1
label = ↑ %output%

[module/eth-download]
type = custom/script
exec = ~/.config/polybar/netinfo.sh down
interval = 3.0
format-underline = #912CEE
label = ↓ %output%

; ===wlan网速度===
[module/wlan-upload]
type = internal/network

interface =wlan0
label-connected = %upspeed:7%
format-connected = <label-connected>

# 填充
;format-connected-padding = 2

;下面横杆
format-connected-underline = #FFE4E1

format-connected-prefix = "↑ "
format-connected-prefix-foreground = ${colors.warning}

[module/wlan-download]
type = internal/network
interface = wlan0
label-connected = %downspeed:7%
format-connected= <label-connected>

# 填充
;format-connected-padding = 2

;下面横杆
format-connected-underline = 	#912CEE

format-connected-prefix = "↓ "
format-connected-prefix-foreground = ${colors.warning}



; ===键盘提示===
; https://github.com/polybar/polybar/wiki/Module:-xkeyboard
[module/xkeyboard]
type = internal/xkeyboard


; 忽略列表
blacklist-0 = scroll lock

; <label-indicator>
format =  <label-indicator>
format-spacing = 1

label-indicator-on-capslock = 
label-indicator-off-capslock =
;label-indicator-on-numlock = 🅽
;label-indicator-off-numlock =

label-indicator-on-capslock-foreground = ${colors.warning}


; ===音量===
; https://github.com/polybar/polybar/wiki/Module:-pulseaudio
[module/pulseaudio]
type = internal/pulseaudio

format-volume = <ramp-volume> <label-volume>

# 填充
format-volume-padding = 2

;下面横杆
format-volume-underline = #CD2990


label-muted =  静音 
label-muted-foreground = #666

ramp-volume-0 = 
ramp-volume-0-foreground = ${colors.success}
ramp-volume-1 = 
ramp-volume-1-foreground = ${colors.success}
ramp-volume-2 = 
ramp-volume-2-foreground = ${colors.success}
ramp-volume-3 = 
ramp-volume-3-foreground = ${colors.success}
ramp-volume-4 = 
ramp-volume-4-foreground = ${colors.notice}
ramp-volume-5 = 
ramp-volume-5-foreground = ${colors.warning}

ramp-volume-foreground = ${colors.nord7}


; ===CPU===
; https://github.com/polybar/polybar/wiki/Module:-cpu
[module/cpu]
type = internal/cpu



; 刷新间隔,默认: 1
interval = 0.5

format = <label> 
;format = <label> <ramp-coreload>

# 填充
format-padding = 2
;下面横杆
format-underline = #CD1076

label = CPU%percentage%%    
label-foreground = ${colors.warning}



;Spacing between individual per-core ramps
ramp-coreload-spacing = 1
ramp-coreload-0 = ▁
ramp-coreload-1 = ▂
ramp-coreload-2 = ▃
ramp-coreload-3 = ▄
ramp-coreload-4 = ▅
ramp-coreload-5 = ▆
ramp-coreload-6 = ▇
ramp-coreload-7 = █

ramp-coreload-0-foreground = #90EE90
ramp-coreload-1-foreground = #90EE90
ramp-coreload-2-foreground = #FF7F24
ramp-coreload-3-foreground = #fba922
ramp-coreload-4-foreground = #fba922
ramp-coreload-5-foreground = #fba922
ramp-coreload-6-foreground = ${colors.warning}
ramp-coreload-7-foreground = ${colors.warning}

; ===内存===
; https://github.com/polybar/polybar/wiki/Module:-memory
[module/memory]

type = internal/memory
interval = 1

format = <label>


# 填充
format-padding = 2

;下面横杆
format-underline = #FFA07A

label = Mem%percentage_used%%

;内存用量渐变色条(低→高:绿→黄→橙→红)
bar-used-width = 10
bar-used-foreground-0 = ${colors.success}
bar-used-foreground-1 = ${colors.notice}
bar-used-foreground-2 = #fba922
bar-used-foreground-3 = ${colors.warning}
bar-used-fill = █
bar-used-empty = ░
bar-used-empty-foreground = #555555
bar-used-indicator =



; ===屏幕亮度===
; https://github.com/polybar/polybar/wiki/Module:-xbacklight
[module/backlight]
type = internal/backlight

; 使用命令查询到设备文件:
; ls -1 /sys/class/backlight/
card = amdgpu_bl0

; 滚轮调节亮度
; sudo chown video /sys/class/backlight/intel_backlight/brightness
; sudo chmod g+w /sys/class/backlight/intel_backlight/brightness
; usermod -a -G video eonun
; Default: false
enable-scroll = true

format = <ramp> <label>

;下面横杆
format-underline = #8B2500

label = %percentage%%  

; 用于 <ramp>
ramp-0 = 🌕
ramp-1 = 🌔
ramp-2 = 🌓
ramp-3 = 🌒
ramp-4 = 🌑
ramp-foreground=${colors.warning}



; 用于 <bar>
bar-width = 10
bar-indicator = 
bar-fill = -
bar-empty = -


; ===日期时间===
; https://github.com/polybar/polybar/wiki/Module:-date
[module/date]
type = internal/date

; 更新间隔, 默认: 1.0
interval = 1.0
format = <label>


; 展开前
#date = %Y-%m-%d%
time = %H:%M:%S 


;展开后
; 另一中格式
#date-alt = %Y-%m-%d-%H:%M:%S
time-alt = %Y年%m月%d日---时间:%H:%M:%S  

#label =  %date%  %time%
label =  %time% 
label-foreground = ${colors.warning}
;显示一个
label-font = 1



; ===电源提示===
; https://github.com/polybar/polybar/wiki/Module:-battery
[module/battery]
type = internal/battery

; 电量大于 99% 显示充电完成
full-at = 99



; 使用以下命令列出电池和适配器:
; ls -1 /sys/class/power_supply/
battery = BAT1
adapter = ACAD

poll-interval = 3

; 时间过格式,默认: %H:%M:%S
#time-format = %M 

; 充电
format-charging =   <animation-charging> <label-charging>

;下面横杆
format-charging-underline = #00C5CD
format-charging-foreground = ${colors.success}
; 放电
format-discharging =  <animation-discharging> <label-discharging>


;下面横杆
format-discharging-underline = #00C5CD
; 充电完成
;format-full = <ramp-capacity> <label-full>
;format-full-foreground = ${colors.warning}

; 充电状态
label-charging =  %percentage% 

;下面横杆
label-charging-underline = #00C5CD


;充电完成

label-full = %percentage% 
;下面横杆
label-full-underline = #00C5CD

label-full-foreground = ${colors.warning}


ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 

bar-capacity-width = 10

animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-3 = 
animation-charging-4 = 
; 动画帧率(毫秒)
animation-charging-framerate = 750

animation-discharging-0 = 
animation-discharging-1 = 
animation-discharging-2 = 
animation-discharging-3 = 
animation-discharging-4 = 
; 动画帧率(毫秒)
animation-discharging-framerate = 500





; ===USB===
; https://github.com/polybar/polybar-scripts/tree/master/polybar-scripts/system-usb-udev
[module/system-usb-udev]
type = custom/script
exec = ~/.config/polybar/scripts/system-usb-udev.sh
tail = true
click-left = ~/.config/polybar/scripts/system-usb-udev.sh --mount &
click-right = ~/.config/polybar/scripts/system-usb-udev.sh --unmount &

; 温度
[module/temperature]

type = internal/temperature
thermal-zone = 0
;到60度就警报
warn-temperature = 60 

;cpu温度
format = <ramp> <label>

# 补充
format-padding = 2

;下面横杆
format-underline = 	#696969


;颜色
format-warn = <ramp> <label-warn>



format-warn-underline = ${self.format-underline}
label =  %temperature-c%

; cpu温度到60度执行
label-warn =  %temperature-c%

; cpu温度到60执行颜色
label-warn-foreground = ${colors.secondary}




ramp-0 = 
ramp-0-foreground =  ${colors.success}
ramp-1 = 
ramp-1-foreground =  ${colors.success}
ramp-2 = 
ramp-2-foreground =  ${colors.success}
ramp-3 = 
ramp-3-foreground =  ${colors.success}
ramp-4 = 
ramp-4-foreground =  ${colors.success}
ramp-5 = 
ramp-5-foreground =  ${colors.success}


; 到老60度就会变成下面的颜色
ramp-6 = 
ramp-6-foreground =  ${colors.secondary} 



;;关机操作
;[module/powermenu]
;type = custom/menu
;expand-right = true
;
;format-spacing = 1
;
;label-open = "  "
;label-open-foreground = ${colors.secondary}
;label-close = "   取消"
;label-close-foreground = ${colors.secondary}
;label-separator = |
;label-separator-foreground = ${colors.foreground-alt}
;
;
;menu-0-0 = 关机
;menu-0-0-exec = poweroff
;menu-0-0-foreground=${colors.warning}
;menu-0-1 = 重启
;menu-0-1-exec = reboot
;menu-0-1-foreground=${colors.warning}
;menu-0-2 = 注销
;menu-0-2-exec = pkill -kill -u fe
;menu-0-2-foreground=${colors.warning}





; === 朗读诗句====
[module/daily-poem]
type = custom/ipc

;下面横杆
format-underline = #8B2500

# replace IDZJPFP9nkjOfsJ5KJO98E4Tgu3DbFHh with your token from https://v2.jinrishici.com/token.
hook-0 = LD_LIBRARY_PATH=$HOME/.config/polybar/scripts/libssl11/usr/lib/x86_64-linux-gnu ~/.config/polybar/scripts/daily-poem require vU1whWzAS7pqAHRkvTD9KxF757ZXcfwS ~/.config/polybar/scripts/poem.txt
hook-1 = LD_LIBRARY_PATH=$HOME/.config/polybar/scripts/libssl11/usr/lib/x86_64-linux-gnu ~/.config/polybar/scripts/daily-poem get ~/.config/polybar/scripts/poem.txt content 
hook-2 = LD_LIBRARY_PATH=$HOME/.config/polybar/scripts/libssl11/usr/lib/x86_64-linux-gnu ~/.config/polybar/scripts/daily-poem get ~/.config/polybar/scripts/poem.txt origin
hook-3 = LD_LIBRARY_PATH=$HOME/.config/polybar/scripts/libssl11/usr/lib/x86_64-linux-gnu ~/.config/polybar/scripts/daily-poem get ~/.config/polybar/scripts/poem.txt match

initial = 1

click-left = polybar-msg -p %pid% hook daily-poem 2
scroll-up = polybar-msg -p %pid% hook daily-poem 3
scroll-down = polybar-msg -p %pid% hook daily-poem 4
click-right = polybar-msg -p %pid% hook daily-poem 1

;显示窗口的名
[module/title]
type = internal/xwindow
; Available tags:
;   <label> (default)
format = <label>


# 填充


;下面横杆
format-underline = 	#8B7765

format-background = ${colors.warning}
format-foreground = 
format-padding = 4

; Available tokens:
;   %title%
; Default: %title%
label = %title%
; 标签名最大显示多少字
label-maxlen = 15

; Used instead of label when there is no window title
; Available tokens:
;   None
label-empty = Empty
label-empty-foreground =  ${colors.warning}

A.3 polybar 启动脚本

.config/polybar/launch.sh(12 行),记得 chmod +x

bash 复制代码
#!/usr/bin/env bash

# Terminate already running bar instances
killall -q polybar
# If all your bars have ipc enabled, you can also use 
# polybar-msg cmd quit

# Launch bar1 and bar2
echo "---" | tee -a /tmp/polybar1.log /tmp/polybar2.log
polybar mybar 2>&1 | tee -a /tmp/polybar1.log & disown

echo "Bars launched..."

A.4 polybar 附加脚本

.config/polybar/scripts/info-hackspeed.sh(63 行)

bash 复制代码
#!/bin/sh
# shellcheck disable=SC2016,SC2059

KEYBOARD_ID="AT Translated Set 2 keyboard"

# cpm: characters per minute
# wpm: words per minute (1 word = 5 characters)
METRIC=cpm
FORMAT=" %d $METRIC"

INTERVAL=20

# If you have a keyboard layout that is not listed here yet, create a condition
# yourself. $3 is the key index. Use `xinput test "AT Translated Set 2 keyboard"`
# to see key codes in real time.  Be sure to open a pull request for your
# layout's condition!
LAYOUT=qwerty

case "$LAYOUT" in
	qwerty) CONDITION='($3 >= 10 && $3 <= 19) || ($3 >= 24 && $3 <= 33) || ($3 >= 37 && $3 <= 53) || ($3 >= 52 && $3 <= 58)'; ;;
	azerty) CONDITION='($3 >= 10 && $3 <= 19) || ($3 >= 24 && $3 <= 33) || ($3 >= 37 && $3 <= 54) || ($3 >= 52 && $3 <= 57)'; ;;
	qwertz) CONDITION='($3 >= 10 && $3 <= 20) || ($3 >= 24 && $3 <= 34) || ($3 == 36) || ($3 >= 38 && $3 <= 48) || ($3 >= 52 && $3 <= 58)'; ;;
        dontcare) CONDITION='1'; ;; # Just register all key presses, not only letters and numbers
	*) echo "Unsupported layout \"$LAYOUT\""; exit 1; ;;
esac

# We have to account for the fact we're not listening a whole minute
multiply_by=60
divide_by=$INTERVAL

case "$METRIC" in
	wpm) divide_by=$((divide_by * 5)); ;;
	cpm) ;;
	*) echo "Unsupported metric \"$METRIC\""; exit 1; ;;
esac

hackspeed_cache="$(mktemp -p '' hackspeed_cache.XXXXX)"
trap 'rm "$hackspeed_cache"' EXIT

# Write a dot to our cache for each key press
printf '' > "$hackspeed_cache"
xinput test "$KEYBOARD_ID" | \
	stdbuf -o0 awk '$1 == "key" && $2 == "press" && ('"$CONDITION"') {printf "."}' >> "$hackspeed_cache" &

while true; do
	# Ask the kernel how big the file is with the command `stat`. The number we
	# get is the file size in bytes, which equals the amount of dots the file
	# contains, and hence how much keys were pressed since the file was last
	# cleared.
	lines=$(stat --format %s "$hackspeed_cache")

	# Truncate the cache file so that in the next iteration, we count only new
	# keypresses
	printf '' > "$hackspeed_cache"

	# The shell only does integer operations, so make sure to first multiply and
	# then divide
	value=$((lines * multiply_by / divide_by))

	printf "$FORMAT\\n" "$value"

	sleep $INTERVAL
done

A.4b

.config/polybar/scripts/openweathermap-fullfeatured.sh(96 行)(天气脚本,使用前到脚本头部填自己的 openweathermap API key)

bash 复制代码
#!/bin/sh

get_icon() {
    case $1 in
        01d) icon="";;
        01n) icon="";;
        02d) icon="";;
        02n) icon="";;
        03*) icon="";;
        04*) icon="";;
        09d) icon="";;
        09n) icon="";;
        10d) icon="";;
        10n) icon="";;
        11d) icon="";;
        11n) icon="";;
        13d) icon="";;
        13n) icon="";;
        50d) icon="";;
        50n) icon="";;
        *) icon="";
    esac

    echo $icon
}

get_duration() {

    osname=$(uname -s)

    case $osname in
        *BSD) date -r "$1" -u +%H:%M;;
        *) date --date="@$1" -u +%H:%M;;
    esac

}

KEY="62628c16e6247d2c1caf0cb398a3dffa"
CITY="Ningbo"
UNITS="metric"
SYMBOL="°C"

API="https://api.openweathermap.org/data/2.5"

if [ -n "$CITY" ]; then
    if [ "$CITY" -eq "$CITY" ] 2>/dev/null; then
        CITY_PARAM="id=$CITY"
    else
        CITY_PARAM="q=$CITY"
    fi

    current=$(curl -sf "$API/weather?appid=$KEY&$CITY_PARAM&units=$UNITS")
    forecast=$(curl -sf "$API/forecast?appid=$KEY&$CITY_PARAM&units=$UNITS&cnt=1")
else
    location=$(curl -sf https://location.services.mozilla.com/v1/geolocate?key=geoclue)

    if [ -n "$location" ]; then
        location_lat="$(echo "$location" | jq '.location.lat')"
        location_lon="$(echo "$location" | jq '.location.lng')"

        current=$(curl -sf "$API/weather?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS")
        forecast=$(curl -sf "$API/forecast?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS&cnt=1")
    fi
fi

if [ -n "$current" ] && [ -n "$forecast" ]; then
    current_temp=$(echo "$current" | jq ".main.temp" | cut -d "." -f 1)
    current_icon=$(echo "$current" | jq -r ".weather[0].icon")

    forecast_temp=$(echo "$forecast" | jq ".list[].main.temp" | cut -d "." -f 1)
    forecast_icon=$(echo "$forecast" | jq -r ".list[].weather[0].icon")

fi
    if [ "$current_temp" -gt "$forecast_temp" ]; then
        trend=""
    elif [ "$forecast_temp" -gt "$current_temp" ]; then
        trend=""
    else
        trend=""
    fi


    sun_rise=$(echo "$current" | jq ".sys.sunrise")
    sun_set=$(echo "$current" | jq ".sys.sunset")
    now=$(date +%s)

    if [ "$sun_rise" -gt "$now" ]; then
        daytime=" $(get_duration "$((sun_rise-now))")"
    elif [ "$sun_set" -gt "$now" ]; then
        daytime=" $(get_duration "$((sun_set-now))")"
    else
        daytime=" $(get_duration "$((sun_rise-now))")"
    fi

    echo "$(get_icon "$current_icon") $current_temp$SYMBOL  $trend  $(get_icon "$forecast_icon") $forecast_temp$SYMBOL   $daytime"
fi

A.4c

.config/polybar/scripts/system-usb-udev.sh(87 行)

bash 复制代码
#!/bin/sh

usb_print() {
    devices=$(lsblk -Jplno NAME,TYPE,RM,SIZE,MOUNTPOINT,VENDOR)
    output=""
    counter=0

    for unmounted in $(echo "$devices" | jq -r '.blockdevices[] | select(.type == "part") | select(.rm == true) | select(.mountpoint == null) | .name'); do
        unmounted=$(echo "$unmounted" | tr -d "[:digit:]")
        unmounted=$(echo "$devices" | jq -r '.blockdevices[] | select(.name == "'"$unmounted"'") | .vendor')
        unmounted=$(echo "$unmounted" | tr -d ' ')

        if [ $counter -eq 0 ]; then
            space=""
        else
            space="   "
        fi
        counter=$((counter + 1))

        output="$output$space#1 $unmounted"
    done

    for mounted in $(echo "$devices" | jq -r '.blockdevices[] | select(.type == "part") | select(.rm == true) | select(.mountpoint != null) | .size'); do
        if [ $counter -eq 0 ]; then
            space=""
        else
            space="   "
        fi
        counter=$((counter + 1))

        output="$output$space#2 $mounted"
    done

    echo "$output"
}

usb_update() {
    pid=$(cat "$path_pid")

    if [ "$pid" != "" ]; then
        kill -10 "$pid"
    fi
}

path_pid="/tmp/polybar-system-usb-udev.pid"

case "$1" in
    --update)
        usb_update
        ;;
    --mount)
        devices=$(lsblk -Jplno NAME,TYPE,RM,MOUNTPOINT)

        for mount in $(echo "$devices" | jq -r '.blockdevices[] | select(.type == "part") | select(.rm == true) | select(.mountpoint == null) | .name'); do
            udisksctl mount --no-user-interaction -b "$mount"

            # mountpoint=$(udisksctl mount --no-user-interaction -b $mount)
            # mountpoint=$(echo $mountpoint | cut -d " " -f 4- | tr -d ".")
            # terminal -e "bash -lc 'filemanager $mountpoint'"
        done

        usb_update
        ;;
    --unmount)
        devices=$(lsblk -Jplno NAME,TYPE,RM,MOUNTPOINT)

        for unmount in $(echo "$devices" | jq -r '.blockdevices[] | select(.type == "part") | select(.rm == true) | select(.mountpoint != null) | .name'); do
            udisksctl unmount --no-user-interaction -b "$unmount"
            udisksctl power-off --no-user-interaction -b "$unmount"
        done

        usb_update
        ;;
    *)
        echo $$ > $path_pid

        trap exit INT
        trap "echo" USR1

        while true; do
            usb_print

            sleep 60 &
            wait
        done
        ;;
esac

A.4d

.config/polybar/scripts/poem.txt(3 行)(诗词模块的备用语料)

text 复制代码
沉恨细思,不如桃杏,犹解嫁东风。
宋代-张先 一丛花令·伤高怀远几时穷
风

A.5 rofi Nord 主题(完整版)

.config/rofi/config.rasi(147 行)

rasi 复制代码
/*
 * ROFI 主题 ------ Nord 柔和夜蓝版
 * 与夜景灯笼壁纸、Kali Dark 桌面风格统一
 */

* {
        nord0: #2E3440;
        nord1: #3B4252;
        nord2: #434C5E;
        nord3: #4C566A;
        nord4: #D8DEE9;
        nord5: #E5E9F0;
        nord6: #ECEFF4;
        nord7: #8FBCBB;
        nord8: #88C0D0;
        nord9: #81A1C1;
        nord10: #5E81AC;
        nord11: #BF616A;
        nord13: #EBCB8B;
        nord14: #A3BE8C;

        accent:  #88C0D0;
        bg:      #2E3440;
        bg-alt:  #3B4252;
        fg:      #ECEFF4;
        fg-dim:  #D8DEE9;
        sel-text: #2E3440;

        spacing: 0;
        background-color: transparent;

        font: "Fira Code 14";
}

window {
        transparency: "real";
        location: center;
        width: 760px;
        background-color: @bg;
        border: 2px;
        border-color: @nord10;
        border-radius: 10px;
}

mainbox {
        children: [inputbar, mode-switcher, listview];
        spacing: 14px;
        padding: 18px 18px 14px 18px;
}

/* ── 搜索栏 ── */
inputbar {
        padding: 12px 18px;
        spacing: 10px;
        background-color: @bg-alt;
        border-radius: 8px;
        children: [prompt, textbox-prompt-colon, entry, case-indicator];
}

prompt {
        text-color: @accent;
}

textbox-prompt-colon {
        expand: false;
        str: ":";
        text-color: @accent;
}

entry {
        text-color: @fg;
        placeholder: "输入以搜索应用...";
        placeholder-color: @nord4;
}

case-indicator {
        text-color: @nord11;
}

/* ── 模式切换标签 ── */
mode-switcher {
        spacing: 6px;
}

button {
        background-color: transparent;
        text-color: @fg-dim;
        padding: 8px 24px;
        border-radius: 8px;
}

button selected {
        background-color: @nord10;
        text-color: @nord6;
}

/* ── 应用列表 ── */
listview {
        scrollbar: true;
        spacing: 3px;
        margin: 0 2px 0 0;
        fixed-height: false;
        lines: 10;
}

scrollbar {
        background-color: transparent;
        handle-color: @nord10;
        handle-width: 6px;
        border: 0;
        margin: 0;
}

element {
        padding: 9px 14px;
        spacing: 12px;
        border-radius: 8px;
}

element-icon {
        size: 24px;
}

element normal {
        background-color: transparent;
}

element selected {
        background-color: @nord1;
        text-color: @accent;
}

element normal normal, element selected normal, element alternate normal {
        text-color: @fg;
}

element normal urgent, element selected urgent, element alternate urgent {
        text-color: @nord11;
}

element normal active, element selected active, element alternate active {
        text-color: @nord14;
}

element selected normal {
        text-color: @nord8;
}

A.6 konsolerc(完整版)

.config/konsolerc(93 行)

ini 复制代码
MenuBar=Disabled
State=AAAA/wAAAAD9AAAAAQAAAAAAAAAAAAAAAPwCAAAAAvsAAAAcAFMAUwBIAE0AYQBuAGEAZwBlAHIARABvAGMAawAAAAAA/////wAAAN0BAAAD+wAAACIAUQB1AGkAYwBrAEMAbwBtAG0AYQBuAGQAcwBEAG8AYwBrAAAAAAD/////AAAAsgEAAAMAAAUAAAACagAAAAQAAAAEAAAACAAAAAj8AAAAAQAAAAIAAAACAAAAFgBtAGEAaQBuAFQAbwBvAGwAQgBhAHIBAAAAAP////8AAAAAAAAAAAAAABwAcwBlAHMAcwBpAG8AbgBUAG8AbwBsAGIAYQByAQAAAVsAAAHvAAAAAAAAAAA=
eDP Height 1920x1080=665
eDP Width 1920x1080=1280
eDP XPosition 1920x1080=320
eDP YPosition 1920x1080=240

[Desktop Entry]
DefaultProfile=Profile 2.profile

[General]
ConfigVersion=1

[KFileDialog Settings]
Recent Files[$e]=lmxlr2.jpg,file:$HOME/桌面/2023-06-04_18-40.png,file:$HOME/图片/壁纸/浏览器/lmxlr2.jpg
Recent URLs[$e]=file:$HOME/图片/壁纸/浏览器/,file:$HOME/桌面/
detailViewIconSize=16

[MainWindow]
1601x917 screen: Height=869
1601x917 screen: Width=1577
1601x917 screen: XPosition=12
1601x917 screen: YPosition=36
1718x918 screen: Height=870
1718x918 screen: Width=841
1718x918 screen: XPosition=865
1718x918 screen: YPosition=36
1918x966 screen: Height=918
1918x966 screen: Width=621
1918x966 screen: XPosition=12
1918x966 screen: YPosition=36
1920x1080 screen: Height=1032
1920x1080 screen: Width=622
1920x1080 screen: XPosition=1286
1920x1080 screen: YPosition=36
2 screens: Height=758
2 screens: Width=1396
2 screens: XPosition=2093
2 screens: YPosition=284
961x569 screen: Height=521
961x569 screen: Width=937
HDMI-A-0=HDMI-A-0
HDMI-A-0 Height 1920x1080=1008
HDMI-A-0 Height 1920x1080 HDMI-A-0=1021
HDMI-A-0 Width 1920x1080=1920
HDMI-A-0 Width 1920x1080 HDMI-A-0=1920
HDMI-A-0 eDP=HDMI-A-0
HDMI-A-0 eDP Height 1080x1920=658
HDMI-A-0 eDP Height 1920x1080=845
HDMI-A-0 eDP Height 1920x1080 HDMI-A-0=671
HDMI-A-0 eDP Height 1920x1080 eDP=686
HDMI-A-0 eDP Width 1080x1920=1080
HDMI-A-0 eDP Width 1920x1080=1738
HDMI-A-0 eDP Width 1920x1080 HDMI-A-0=1295
HDMI-A-0 eDP Width 1920x1080 eDP=1296
HDMI-A-0 eDP Window-Maximized 1080x1920 HDMI-A-0=true
HDMI-A-0 eDP Window-Maximized 1920x1080 eDP=true
HDMI-A-0 eDP XPosition 1920x1080=2074
HDMI-A-0 eDP XPosition 1920x1080 HDMI-A-0=2030
HDMI-A-0 eDP XPosition 1920x1080 eDP=591
HDMI-A-0 eDP YPosition 1920x1080=72
HDMI-A-0 eDP YPosition 1920x1080 HDMI-A-0=180
HDMI-A-0 eDP YPosition 1920x1080 eDP=313
MenuBar=Disabled
Virtual1=Virtual1
eDP=eDP
eDP HDMI-A-0=eDP
eDP HDMI-A-0 Height 1280x800 HDMI-A-0=562
eDP HDMI-A-0 Height 1920x1080 HDMI-A-0=592
eDP HDMI-A-0 Height 1920x1080 eDP=1021
eDP HDMI-A-0 Width 1280x800 HDMI-A-0=1133
eDP HDMI-A-0 Width 1920x1080 HDMI-A-0=1390
eDP HDMI-A-0 Width 1920x1080 eDP=1920
eDP HDMI-A-0 XPosition 1280x800 HDMI-A-0=2196
eDP HDMI-A-0 XPosition 1920x1080 HDMI-A-0=412
eDP HDMI-A-0 XPosition 1920x1080 eDP=653
eDP HDMI-A-0 YPosition 1280x800 HDMI-A-0=145
eDP HDMI-A-0 YPosition 1920x1080 HDMI-A-0=178
eDP HDMI-A-0 YPosition 1920x1080 eDP=548
eDP Height 1920x1080=665
eDP Height 1920x1080 eDP=1021
eDP Width 1920x1080=1280
eDP Width 1920x1080 eDP=1920
eDP XPosition 1920x1080=460
eDP XPosition 1920x1080 eDP=0
eDP YPosition 1920x1080=122
eDP YPosition 1920x1080 eDP=59

[Notification Messages]
CloseAllTabs=true

[UiSettings]
ColorScheme=

A.6b kdeglobals------konsole 工具栏("标题栏")字体

konsole 窗口顶部"新建标签页 / 拆分视图 / 复制 / 粘贴"工具栏的文字大小

由 ~/.config/kdeglobals 控制(不跟 Profile 字体走)。缩小它的写法:

ini 复制代码
[General]
toolBarFont=Noto Sans,9,-1,5,50,0,0,0,0,0

改完重启 konsole 生效。想更小把 9 改 8;kdeglobals.bak-tb 为改动前备份。

A.7 konsole Profile 与配色方案

.local/share/konsole/Kali Dark.profile(6 行)

ini 复制代码
[Appearance]
ColorScheme=Kali-Dark

[General]
Name=Kali Dark
Parent=FALLBACK/

A.7b

.local/share/konsole/Profile 1.profile(6 行)

ini 复制代码
[Appearance]
ColorScheme=Kali-Dark

[General]
Name=Profile 1
Parent=FALLBACK/

A.7c

.local/share/konsole/Profile 2.profile(12 行)

ini 复制代码
[Appearance]
ColorScheme=Kali-Dark
Font=Fira Code Retina,12,-1,5,53,0,0,0,0,0,Regular

[General]
Name=Profile 2
Parent=FALLBACK/
StartInCurrentSessionDir=true

[Scrolling]
HistoryMode=2
ScrollBarPosition=2

A.7d

.local/share/konsole/Profile 3.profile(6 行)

ini 复制代码
[General]
Name=Profile 3
Parent=/home/sirius/.local/share/konsole/Profile 2.profile

[Interaction Options]
TrimLeadingSpacesInSelectedText=false

A.7e

.local/share/konsole/Kali-Dark.colorscheme(100 行)(配色方案,konsole 自带同名主题可跳过)

ini 复制代码
[Background]
Color=43,45,56

[BackgroundFaint]
Color=35,37,46

[BackgroundIntense]
Color=35,37,46

[Color0]
Color=31,34,41

[Color0Faint]
Color=31,34,41

[Color0Intense]
Color=23,123,126

[Color1]
Color=212,25,25

[Color1Faint]
Color=212,25,25

[Color1Intense]
Color=236,1,1

[Color2]
Color=90,180,160

[Color2Faint]
Color=79,159,142

[Color2Intense]
Color=71,212,185

[Color3]
Color=254,164,76

[Color3Faint]
Color=254,164,76

[Color3Intense]
Color=255,138,24

[Color4]
Color=0,180,180

[Color4Faint]
Color=125,156,240

[Color4Intense]
Color=46,238,255

[Color5]
Color=151,85,179

[Color5Faint]
Color=151,85,179

[Color5Intense]
Color=150,42,195

[Color6]
Color=73,174,230

[Color6Faint]
Color=73,174,230

[Color6Intense]
Color=80,161,247

[Color7]
Color=153,153,153

[Color7Faint]
Color=230,230,230

[Color7Intense]
Color=255,255,255

[Foreground]
Color=0,209,209

[ForegroundFaint]
Color=255,255,255

[ForegroundIntense]
Color=255,255,255

[General]
Anchor=0.5,0.5
Blur=true
ColorRandomization=false
Description=Kali Dark
FillStyle=Tile
Opacity=0.83
Wallpaper=
WallpaperFlipType=NoFlip
WallpaperOpacity=1

A.8 zshrc(完整版)

.zshrc(292 行),注意把 /home/sirius 替换成你的用户名

bash 复制代码
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# Start configuration added by Zim install {{{
#
# User configuration sourced by interactive shells
#

# -----------------
# Zsh configuration
# -----------------

#
# History
#

# Remove older command from the history if a duplicate is to be added.
setopt HIST_IGNORE_ALL_DUPS

#
# Input/output
#

# Set editor default keymap to emacs (`-e`) or vi (`-v`)
bindkey -e

# Prompt for spelling correction of commands.
#setopt CORRECT

# Customize spelling correction prompt.
#SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? '

# Remove path separator from WORDCHARS.
WORDCHARS=${WORDCHARS//[\/]}

# -----------------
# Zim configuration
# -----------------

# Use degit instead of git as the default tool to install and update modules.
#zstyle ':zim:zmodule' use 'degit'

# --------------------
# Module configuration
# --------------------

#
# git
#

# Set a custom prefix for the generated aliases. The default prefix is 'G'.
#zstyle ':zim:git' aliases-prefix 'g'

#
# input
#

# Append `../` to your input for each `.` you type after an initial `..`
#zstyle ':zim:input' double-dot-expand yes

#
# termtitle
#

# Set a custom terminal title format using prompt expansion escape sequences.
# See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
# If none is provided, the default '%n@%m: %~' is used.
#zstyle ':zim:termtitle' format '%1~'

#
# zsh-autosuggestions
#

# Disable automatic widget re-binding on each precmd. This can be set when
# zsh-users/zsh-autosuggestions is the last module in your ~/.zimrc.
ZSH_AUTOSUGGEST_MANUAL_REBIND=1

# Customize the style that the suggestions are shown with.
# See https://github.com/zsh-users/zsh-autosuggestions/blob/master/README.md#suggestion-highlight-style
#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=242'

#
# zsh-syntax-highlighting
#

# Set what highlighters will be used.
# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)

# Customize the main highlighter styles.
# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md#how-to-tweak-it
#typeset -A ZSH_HIGHLIGHT_STYLES
#ZSH_HIGHLIGHT_STYLES[comment]='fg=242'

# ------------------
# Initialize modules
# ------------------

ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
# Download zimfw plugin manager if missing.
if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then
  if (( ${+commands[curl]} )); then
    curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh \
        https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
  else
    mkdir -p ${ZIM_HOME} && wget -nv -O ${ZIM_HOME}/zimfw.zsh \
        https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh
  fi
fi
# Install missing modules, and update ${ZIM_HOME}/init.zsh if missing or outdated.
if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
  source ${ZIM_HOME}/zimfw.zsh init -q
fi
# Initialize modules.
source ${ZIM_HOME}/init.zsh

# ------------------------------
# Post-init module configuration
# ------------------------------

#
# zsh-history-substring-search
#

zmodload -F zsh/terminfo +p:terminfo
# Bind ^[[A/^[[B manually so up/down works both before and after zle-line-init
for key ('^[[A' '^P' ${terminfo[kcuu1]}) bindkey ${key} history-substring-search-up
for key ('^[[B' '^N' ${terminfo[kcud1]}) bindkey ${key} history-substring-search-down
for key ('k') bindkey -M vicmd ${key} history-substring-search-up
for key ('j') bindkey -M vicmd ${key} history-substring-search-down
unset key
# }}} End configuration added by Zim install

# 自己配置
# 命令
# alias ne 已改为 fastfetch(见下方 fastfetch alias)
alias l="lolcat"
alias 代理="proxychains4"
alias 搜索="find ./ -name"
alias 查询="grep"
alias 删除夹="rm -r"
alias 创建夹="mkdir"
alias 程序搜索="whereis"
alias 权限="chown"
alias 更新时间=" /etc/init.d/ntp start"
alias 结束="kill -9"
alias 关机="shutdown now"
alias 重启="reboot"
alias 注销="logout"
alias 解压rar="unrar x "
alias 解压bz2="bunzip2"
alias 解压gz="gunzip "
alias 安装="sudo apt-get install "
alias 卸载="sudo apt-get purge"
alias 更新="sudo apt-get dist-upgrade"
alias 系统="uname -a"	
alias h="htop"
alias 下载="wget"
alias tcp="netstat -ntlp"
alias udp="netstat -nulp"
alias r="ranger"
alias t="tree"
# ========================fzf配置================================
# 要调用的配置文件
source ~/.fzf/shell/key-bindings.zsh
source ~/.fzf/shell/completion.zsh
# 在终端输入
export FZF_DEFAULT_COMMAND='find .'
# 输入\触发
export FZF_COMPLETION_TRIGGER='\'
export FZF_TMUX=1
# 大小
export FZF_TMUX_HEIGHT='90%'
#export FZF_DEFAULT_OPTS='--height 90% --layout=reverse  --border --preview "echo {} | ~/.oh-my-zsh/file_preview.py" --preview-window=down'
# 下面是显示效果
export FZF_DEFAULT_OPTS='  --preview "[[ $(file --mime {}) =~ binary ]]  && echo {}  | ~/.oh-my-zsh/file_preview.py  || (ccat --color=always {} || highlight -O ansi -l {} || cat {}) 2> /dev/null | head -500 " '
export FZF_PREVIEW_COMMAND='[[ $(file --mime {}) =~ binary ]] && echo {} is a binary file || (ccat --color=always {} || highlight -O ansi -l {} || cat {}) 2> /dev/null | head -500'
# fzf颜色
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
--color=dark
--color=fg:-1,bg:-1,hl:#5fff87,fg+:-1,bg+:-1,hl+:#ffaf5f
--color=info:#af87ff,prompt:#5fff87,pointer:#ff87d7,marker:#ff87d7,spinner:#ff87d7
'
# 输入vim调用这会执行{}里面的内容,-type f 只搜索文件
_fzf_compgen_path() {
  find * -type f  
}
# 输入vim调用这会执行{}里面的内容,-type d 只搜索文件夹
_fzf_compgen_dir() {
  find * -type d 
}
plugins=(
	git
	zsh-autosuggestions
	zsh-syntax-highlighting
	fzf-zsh-plugin 
	#fzf-tab #自动补全
	)
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/sirius/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#ZSH_THEME="jonathan"
#ZSH_THEME="funky"
#ZSH_THEME="agnoster"
#ZSH_THEME="ys"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
#source ~/.oh-my-zsh/plugins/incr/incr*.zsh

# -- START ACTIVESTATE INSTALLATION
#export PATH="/home/sirius/.local/ActiveState/StateTool/release/bin:$PATH"
# -- STOP ACTIVESTATE INSTALLATION
# -- START ACTIVESTATE DEFAULT RUNTIME ENVIRONMENT
#export PATH="/home/sirius/.cache/activestate/bin:$PATH"
# -- STOP ACTIVESTATE DEFAULT RUNTIME ENVIRONMENT

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
(( ! ${+functions[p10k]} )) || p10k finalize
alias ne="fastfetch | lolcat"

A.8b zimrc(完整版)

.zimrc(170 行)

zsh 复制代码
# 自己添加的
zmodule romkatv/powerlevel10k

# Start configuration added by Zim install {{{
#
# This is not sourced during shell startup, and it's only used to configure the
# zimfw plugin manager.
#

#
# Modules
#

# Sets sane Zsh built-in environment options.
zmodule environment
# Provides handy git aliases and functions.
zmodule git
# Applies correct bindkeys for input events.
zmodule input
# Sets a custom terminal title.
zmodule termtitle
# Utility aliases and functions. Adds colour to ls, grep and less.
zmodule utility

#
# Prompt
#

# Exposes to prompts how long the last command took to execute, used by asciiship.
zmodule duration-info
# Exposes git repository status information to prompts, used by asciiship.
zmodule git-info
# A heavily reduced, ASCII-only version of the Spaceship and Starship prompts.
zmodule asciiship

#
# Completion
#

# Additional completion definitions for Zsh.
zmodule zsh-users/zsh-completions --fpath src
# Enables and configures smart and extensive tab completion.
# completion must be sourced after all modules that add completion definitions.
zmodule completion

#
# Modules that must be initialized last
#

# Fish-like syntax highlighting for Zsh.
# zsh-users/zsh-syntax-highlighting must be sourced after completion
zmodule zsh-users/zsh-syntax-highlighting
# Fish-like history search (up arrow) for Zsh.
# zsh-users/zsh-history-substring-search must be sourced after zsh-users/zsh-syntax-highlighting
zmodule zsh-users/zsh-history-substring-search
# Fish-like autosuggestions for Zsh.
zmodule zsh-users/zsh-autosuggestions
# }}} End configuration added by Zim install

# Start configuration added by Zim install {{{
#
# This is not sourced during shell startup, and it's only used to configure the
# zimfw plugin manager.
#

#
# Modules
#

# Sets sane Zsh built-in environment options.
zmodule environment
# Provides handy git aliases and functions.
zmodule git
# Applies correct bindkeys for input events.
zmodule input
# Sets a custom terminal title.
zmodule termtitle
# Utility aliases and functions. Adds colour to ls, grep and less.
zmodule utility

#
# Prompt
#

# Exposes to prompts how long the last command took to execute, used by asciiship.
zmodule duration-info
# Exposes git repository status information to prompts, used by asciiship.
zmodule git-info
# A heavily reduced, ASCII-only version of the Spaceship and Starship prompts.
zmodule asciiship

#
# Completion
#

# Additional completion definitions for Zsh.
zmodule zsh-users/zsh-completions --fpath src
# Enables and configures smart and extensive tab completion.
# completion must be sourced after all modules that add completion definitions.
zmodule completion

#
# Modules that must be initialized last
#

# Fish-like syntax highlighting for Zsh.
# zsh-users/zsh-syntax-highlighting must be sourced after completion
zmodule zsh-users/zsh-syntax-highlighting
# Fish-like history search (up arrow) for Zsh.
# zsh-users/zsh-history-substring-search must be sourced after zsh-users/zsh-syntax-highlighting
zmodule zsh-users/zsh-history-substring-search
# Fish-like autosuggestions for Zsh.
zmodule zsh-users/zsh-autosuggestions
# }}} End configuration added by Zim install

# Start configuration added by Zim install {{{
#
# This is not sourced during shell startup, and it's only used to configure the
# zimfw plugin manager.
#

#
# Modules
#

# Sets sane Zsh built-in environment options.
zmodule environment
# Provides handy git aliases and functions.
zmodule git
# Applies correct bindkeys for input events.
zmodule input
# Sets a custom terminal title.
zmodule termtitle
# Utility aliases and functions. Adds colour to ls, grep and less.
zmodule utility

#
# Prompt
#

# Exposes to prompts how long the last command took to execute, used by asciiship.
zmodule duration-info
# Exposes git repository status information to prompts, used by asciiship.
zmodule git-info
# A heavily reduced, ASCII-only version of the Spaceship and Starship prompts.
zmodule asciiship

#
# Completion
#

# Additional completion definitions for Zsh.
zmodule zsh-users/zsh-completions --fpath src
# Enables and configures smart and extensive tab completion.
# completion must be sourced after all modules that add completion definitions.
zmodule completion

#
# Modules that must be initialized last
#

# Fish-like syntax highlighting for Zsh.
# zsh-users/zsh-syntax-highlighting must be sourced after completion
zmodule zsh-users/zsh-syntax-highlighting
# Fish-like history search (up arrow) for Zsh.
# zsh-users/zsh-history-substring-search must be sourced after zsh-users/zsh-syntax-highlighting
zmodule zsh-users/zsh-history-substring-search
# Fish-like autosuggestions for Zsh.
zmodule zsh-users/zsh-autosuggestions
# }}} End configuration added by Zim install

A.8c p10k 提示符配置(完整版)

.p10k.zsh(1826 行)

zsh 复制代码
# Generated by Powerlevel10k configuration wizard on 2023-09-13 at 00:52 CST.
# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 47269.
# Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode,
# angled separators, sharp heads, flat tails, 1 line, sparse, many icons, concise,
# instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with powerline prompt style with colorful background.
# Type `p10k configure` to generate your own config based on it.
#
# Tip: Looking for a nice color? Here's a one-liner to print colormap.
#
#   for i in {0..255}; do print -Pn "%K{$i}  %k%F{$i}${(l:3::0:)i}%f " ${${(M)$((i%6)):#3}:+$'\n'}; done

# Temporarily change options.
'builtin' 'local' '-a' 'p10k_config_opts'
[[ ! -o 'aliases'         ]] || p10k_config_opts+=('aliases')
[[ ! -o 'sh_glob'         ]] || p10k_config_opts+=('sh_glob')
[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'

() {
  emulate -L zsh -o extended_glob

  # Unset all configuration options. This allows you to apply configuration changes without
  # restarting zsh. Edit ~/.p10k.zsh and type `source ~/.p10k.zsh`.
  unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'

  # Zsh >= 5.1 is required.
  [[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return

  # The list of segments shown on the left. Fill it with the most important segments.
  typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
    os_icon                 # os identifier
    dir                     # current directory
    vcs                     # git status
    # prompt_char           # prompt symbol
  )

  # The list of segments shown on the right. Fill it with less important segments.
  # Right prompt on the last prompt line (where you are typing your commands) gets
  # automatically hidden when the input line reaches it. Right prompt above the
  # last prompt line gets hidden if it would overlap with left prompt.
  typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
    status                  # exit code of the last command
    command_execution_time  # duration of the last command
    background_jobs         # presence of background jobs
    direnv                  # direnv status (https://direnv.net/)
    asdf                    # asdf version manager (https://github.com/asdf-vm/asdf)
    virtualenv              # python virtual environment (https://docs.python.org/3/library/venv.html)
    anaconda                # conda environment (https://conda.io/)
    pyenv                   # python environment (https://github.com/pyenv/pyenv)
    goenv                   # go environment (https://github.com/syndbg/goenv)
    nodenv                  # node.js version from nodenv (https://github.com/nodenv/nodenv)
    nvm                     # node.js version from nvm (https://github.com/nvm-sh/nvm)
    nodeenv                 # node.js environment (https://github.com/ekalinin/nodeenv)
    # node_version          # node.js version
    # go_version            # go version (https://golang.org)
    # rust_version          # rustc version (https://www.rust-lang.org)
    # dotnet_version        # .NET version (https://dotnet.microsoft.com)
    # php_version           # php version (https://www.php.net/)
    # laravel_version       # laravel php framework version (https://laravel.com/)
    # java_version          # java version (https://www.java.com/)
    # package               # name@version from package.json (https://docs.npmjs.com/files/package.json)
    rbenv                   # ruby version from rbenv (https://github.com/rbenv/rbenv)
    rvm                     # ruby version from rvm (https://rvm.io)
    fvm                     # flutter version management (https://github.com/leoafarias/fvm)
    luaenv                  # lua version from luaenv (https://github.com/cehoffman/luaenv)
    jenv                    # java version from jenv (https://github.com/jenv/jenv)
    plenv                   # perl version from plenv (https://github.com/tokuhirom/plenv)
    perlbrew                # perl version from perlbrew (https://github.com/gugod/App-perlbrew)
    phpenv                  # php version from phpenv (https://github.com/phpenv/phpenv)
    scalaenv                # scala version from scalaenv (https://github.com/scalaenv/scalaenv)
    haskell_stack           # haskell version from stack (https://haskellstack.org/)
    kubecontext             # current kubernetes context (https://kubernetes.io/)
    terraform               # terraform workspace (https://www.terraform.io)
    # terraform_version     # terraform version (https://www.terraform.io)
    aws                     # aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
    aws_eb_env              # aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/)
    azure                   # azure account name (https://docs.microsoft.com/en-us/cli/azure)
    gcloud                  # google cloud cli account and project (https://cloud.google.com/)
    google_app_cred         # google application credentials (https://cloud.google.com/docs/authentication/production)
    toolbox                 # toolbox name (https://github.com/containers/toolbox)
    # context                 # user@hostname
    nordvpn                 # nordvpn connection status, linux only (https://nordvpn.com/)
    ranger                  # ranger shell (https://github.com/ranger/ranger)
    nnn                     # nnn shell (https://github.com/jarun/nnn)
    lf                      # lf shell (https://github.com/gokcehan/lf)
    xplr                    # xplr shell (https://github.com/sayanarijit/xplr)
    vim_shell               # vim shell indicator (:sh)
    midnight_commander      # midnight commander shell (https://midnight-commander.org/)
    nix_shell               # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
    chezmoi_shell           # chezmoi shell (https://www.chezmoi.io/)
    vi_mode                 # vi mode (you don't need this if you've enabled prompt_char)
    # vpn_ip                # virtual private network indicator
    # load                  # CPU load
    # disk_usage            # disk usage
    # ram                   # free RAM
    # swap                  # used swap
    todo                    # todo items (https://github.com/todotxt/todo.txt-cli)
    timewarrior             # timewarrior tracking status (https://timewarrior.net/)
    taskwarrior             # taskwarrior task count (https://taskwarrior.org/)
    per_directory_history   # Oh My Zsh per-directory-history local/global indicator
    # cpu_arch              # CPU architecture
    # time                  # current time
    # ip                    # ip address and bandwidth usage for a specified network interface
    # public_ip             # public IP address
    # proxy                 # system-wide http/https/ftp proxy
    # battery               # internal battery
    # wifi                  # wifi speed
    # example               # example user-defined segment (see prompt_example function below)
  )

  # Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you.
  typeset -g POWERLEVEL9K_MODE=nerdfont-complete
  # When set to `moderate`, some icons will have an extra space after them. This is meant to avoid
  # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added.
  typeset -g POWERLEVEL9K_ICON_PADDING=none

  # When set to true, icons appear before content on both sides of the prompt. When set
  # to false, icons go after content. If empty or not set, icons go before content in the left
  # prompt and after content in the right prompt.
  #
  # You can also override it for a specific segment:
  #
  #   POWERLEVEL9K_STATUS_ICON_BEFORE_CONTENT=false
  #
  # Or for a specific segment in specific state:
  #
  #   POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false
  typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=

  # Add an empty line before each prompt.
  typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true

  # Connect left prompt lines with these symbols. You'll probably want to use the same color
  # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below.
  typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%242F╭─'
  typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%242F├─'
  typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%242F╰─'
  # Connect right prompt lines with these symbols.
  typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX='%242F─╮'
  typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX='%242F─┤'
  typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX='%242F─╯'

  # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or
  # '─'. The last two make it easier to see the alignment between left and right prompt and to
  # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
  # for more compact prompt if using this option.
  typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
  typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND=
  typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND=
  if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then
    # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE
    # ornaments defined above.
    typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242
    # Start filler from the edge of the screen if there are no left segments on the first line.
    typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}'
    # End filler on the edge of the screen if there are no right segments on the first line.
    typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}'
  fi

  # Separator between same-color segments on the left.
  typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1'
  # Separator between same-color segments on the right.
  typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3'
  # Separator between different-color segments on the left.
  typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0'
  # Separator between different-color segments on the right.
  typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2'
  # To remove a separator between two segments, add "_joined" to the second segment name.
  # For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined)

  # The right end of left prompt.
  typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
  # The left end of right prompt.
  typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2'
  # The left end of left prompt.
  typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=''
  # The right end of right prompt.
  typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL=''
  # Left prompt terminator for lines without any segments.
  typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=

  #################################[ os_icon: os identifier ]##################################
  # OS identifier color.
  typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=232
  typeset -g POWERLEVEL9K_OS_ICON_BACKGROUND=7
  # Custom icon.
  # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐'

  ################################[ prompt_char: prompt symbol ]################################
  # Transparent background.
  typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND=
  # Green prompt symbol if the last command succeeded.
  typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76
  # Red prompt symbol if the last command failed.
  typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196
  # Default prompt symbol.
  typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯'
  # Prompt symbol in command vi mode.
  typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
  # Prompt symbol in visual vi mode.
  typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V'
  # Prompt symbol in overwrite vi mode.
  typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
  typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
  # No line terminator if prompt_char is the last segment.
  typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=
  # No line introducer if prompt_char is the first segment.
  typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL=
  # No surrounding whitespace.
  typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE=

  ##################################[ dir: current directory ]##################################
  # Current directory background color.
  typeset -g POWERLEVEL9K_DIR_BACKGROUND=4
  # Default current directory foreground color.
  typeset -g POWERLEVEL9K_DIR_FOREGROUND=254
  # If directory is too long, shorten some of its segments to the shortest possible unique
  # prefix. The shortened directory can be tab-completed to the original.
  typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
  # Replace removed segment suffixes with this symbol.
  typeset -g POWERLEVEL9K_SHORTEN_DELIMITER=
  # Color of the shortened directory segments.
  typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250
  # Color of the anchor directory segments. Anchor segments are never shortened. The first
  # segment is always an anchor.
  typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255
  # Display anchor directory segments in bold.
  typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true
  # Don't shorten directories that contain any of these files. They are anchors.
  local anchor_files=(
    .bzr
    .citc
    .git
    .hg
    .node-version
    .python-version
    .go-version
    .ruby-version
    .lua-version
    .java-version
    .perl-version
    .php-version
    .tool-version
    .shorten_folder_marker
    .svn
    .terraform
    CVS
    Cargo.toml
    composer.json
    go.mod
    package.json
    stack.yaml
  )
  typeset -g POWERLEVEL9K_SHORTEN_FOLDER_MARKER="(${(j:|:)anchor_files})"
  # If set to "first" ("last"), remove everything before the first (last) subdirectory that contains
  # files matching $POWERLEVEL9K_SHORTEN_FOLDER_MARKER. For example, when the current directory is
  # /foo/bar/git_repo/nested_git_repo/baz, prompt will display git_repo/nested_git_repo/baz (first)
  # or nested_git_repo/baz (last). This assumes that git_repo and nested_git_repo contain markers
  # and other directories don't.
  #
  # Optionally, "first" and "last" can be followed by ":<offset>" where <offset> is an integer.
  # This moves the truncation point to the right (positive offset) or to the left (negative offset)
  # relative to the marker. Plain "first" and "last" are equivalent to "first:0" and "last:0"
  # respectively.
  typeset -g POWERLEVEL9K_DIR_TRUNCATE_BEFORE_MARKER=false
  # Don't shorten this many last directory segments. They are anchors.
  typeset -g POWERLEVEL9K_SHORTEN_DIR_LENGTH=1
  # Shorten directory if it's longer than this even if there is space for it. The value can
  # be either absolute (e.g., '80') or a percentage of terminal width (e.g, '50%'). If empty,
  # directory will be shortened only when prompt doesn't fit or when other parameters demand it
  # (see POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS and POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT below).
  # If set to `0`, directory will always be shortened to its minimum length.
  typeset -g POWERLEVEL9K_DIR_MAX_LENGTH=80
  # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least this
  # many columns for typing commands.
  typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS=40
  # When `dir` segment is on the last prompt line, try to shorten it enough to leave at least
  # COLUMNS * POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT * 0.01 columns for typing commands.
  typeset -g POWERLEVEL9K_DIR_MIN_COMMAND_COLUMNS_PCT=50
  # If set to true, embed a hyperlink into the directory. Useful for quickly
  # opening a directory in the file manager simply by clicking the link.
  # Can also be handy when the directory is shortened, as it allows you to see
  # the full directory that was used in previous commands.
  typeset -g POWERLEVEL9K_DIR_HYPERLINK=false

  # Enable special styling for non-writable and non-existent directories. See POWERLEVEL9K_LOCK_ICON
  # and POWERLEVEL9K_DIR_CLASSES below.
  typeset -g POWERLEVEL9K_DIR_SHOW_WRITABLE=v3

  # The default icon shown next to non-writable and non-existent directories when
  # POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3.
  # typeset -g POWERLEVEL9K_LOCK_ICON='⭐'

  # POWERLEVEL9K_DIR_CLASSES allows you to specify custom icons and colors for different
  # directories. It must be an array with 3 * N elements. Each triplet consists of:
  #
  #   1. A pattern against which the current directory ($PWD) is matched. Matching is done with
  #      extended_glob option enabled.
  #   2. Directory class for the purpose of styling.
  #   3. An empty string.
  #
  # Triplets are tried in order. The first triplet whose pattern matches $PWD wins.
  #
  # If POWERLEVEL9K_DIR_SHOW_WRITABLE is set to v3, non-writable and non-existent directories
  # acquire class suffix _NOT_WRITABLE and NON_EXISTENT respectively.
  #
  # For example, given these settings:
  #
  #   typeset -g POWERLEVEL9K_DIR_CLASSES=(
  #     '~/work(|/*)'  WORK     ''
  #     '~(|/*)'       HOME     ''
  #     '*'            DEFAULT  '')
  #
  # Whenever the current directory is ~/work or a subdirectory of ~/work, it gets styled with one
  # of the following classes depending on its writability and existence: WORK, WORK_NOT_WRITABLE or
  # WORK_NON_EXISTENT.
  #
  # Simply assigning classes to directories doesn't have any visible effects. It merely gives you an
  # option to define custom colors and icons for different directory classes.
  #
  #   # Styling for WORK.
  #   typeset -g POWERLEVEL9K_DIR_WORK_VISUAL_IDENTIFIER_EXPANSION='⭐'
  #   typeset -g POWERLEVEL9K_DIR_WORK_BACKGROUND=4
  #   typeset -g POWERLEVEL9K_DIR_WORK_FOREGROUND=254
  #   typeset -g POWERLEVEL9K_DIR_WORK_SHORTENED_FOREGROUND=250
  #   typeset -g POWERLEVEL9K_DIR_WORK_ANCHOR_FOREGROUND=255
  #
  #   # Styling for WORK_NOT_WRITABLE.
  #   typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_VISUAL_IDENTIFIER_EXPANSION='⭐'
  #   typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_BACKGROUND=4
  #   typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND=254
  #   typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_SHORTENED_FOREGROUND=250
  #   typeset -g POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_ANCHOR_FOREGROUND=255
  #
  #   # Styling for WORK_NON_EXISTENT.
  #   typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_VISUAL_IDENTIFIER_EXPANSION='⭐'
  #   typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_BACKGROUND=4
  #   typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_FOREGROUND=254
  #   typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_SHORTENED_FOREGROUND=250
  #   typeset -g POWERLEVEL9K_DIR_WORK_NON_EXISTENT_ANCHOR_FOREGROUND=255
  #
  # If a styling parameter isn't explicitly defined for some class, it falls back to the classless
  # parameter. For example, if POWERLEVEL9K_DIR_WORK_NOT_WRITABLE_FOREGROUND is not set, it falls
  # back to POWERLEVEL9K_DIR_FOREGROUND.
  #
  # typeset -g POWERLEVEL9K_DIR_CLASSES=()

  # Custom prefix.
  # typeset -g POWERLEVEL9K_DIR_PREFIX='in '

  #####################################[ vcs: git status ]######################################
  # Version control background colors.
  typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2
  typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3
  typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2
  typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3
  typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8

  # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon.
  typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 '

  # Untracked files icon. It's really a question mark, your font isn't broken.
  # Change the value of this parameter to show a different icon.
  typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?'

  # Formatter for Git status.
  #
  # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
  #
  # You can edit the function to customize how Git status looks.
  #
  # VCS_STATUS_* parameters are set by gitstatus plugin. See reference:
  # https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh.
  function my_git_formatter() {
    emulate -L zsh

    if [[ -n $P9K_CONTENT ]]; then
      # If P9K_CONTENT is not empty, use it. It's either "loading" or from vcs_info (not from
      # gitstatus plugin). VCS_STATUS_* parameters are not available in this case.
      typeset -g my_git_format=$P9K_CONTENT
      return
    fi

    # Styling for different parts of Git status.
    local       meta='%7F' # white foreground
    local      clean='%0F' # black foreground
    local   modified='%0F' # black foreground
    local  untracked='%0F' # black foreground
    local conflicted='%1F' # red foreground

    local res

    if [[ -n $VCS_STATUS_LOCAL_BRANCH ]]; then
      local branch=${(V)VCS_STATUS_LOCAL_BRANCH}
      # If local branch name is at most 32 characters long, show it in full.
      # Otherwise show the first 12 ... the last 12.
      # Tip: To always show local branch name in full without truncation, delete the next line.
      (( $#branch > 32 )) && branch[13,-13]="..."  # <-- this line
      res+="${clean}${(g::)POWERLEVEL9K_VCS_BRANCH_ICON}${branch//\%/%%}"
    fi

    if [[ -n $VCS_STATUS_TAG
          # Show tag only if not on a branch.
          # Tip: To always show tag, delete the next line.
          && -z $VCS_STATUS_LOCAL_BRANCH  # <-- this line
        ]]; then
      local tag=${(V)VCS_STATUS_TAG}
      # If tag name is at most 32 characters long, show it in full.
      # Otherwise show the first 12 ... the last 12.
      # Tip: To always show tag name in full without truncation, delete the next line.
      (( $#tag > 32 )) && tag[13,-13]="..."  # <-- this line
      res+="${meta}#${clean}${tag//\%/%%}"
    fi

    # Display the current Git commit if there is no branch and no tag.
    # Tip: To always display the current Git commit, delete the next line.
    [[ -z $VCS_STATUS_LOCAL_BRANCH && -z $VCS_STATUS_TAG ]] &&  # <-- this line
      res+="${meta}@${clean}${VCS_STATUS_COMMIT[1,8]}"

    # Show tracking branch name if it differs from local branch.
    if [[ -n ${VCS_STATUS_REMOTE_BRANCH:#$VCS_STATUS_LOCAL_BRANCH} ]]; then
      res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"
    fi

    # Display "wip" if the latest commit's summary contains "wip" or "WIP".
    if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then
      res+=" ${modified}wip"
    fi

    if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then
      # ⇣42 if behind the remote.
      (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
      # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
      (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
      (( VCS_STATUS_COMMITS_AHEAD  )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}"
    elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then
      # Tip: Uncomment the next line to display '=' if up to date with the remote.
      # res+=" ${clean}="
    fi

    # ⇠42 if behind the push remote.
    (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}"
    (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
    # ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42.
    (( VCS_STATUS_PUSH_COMMITS_AHEAD  )) && res+="${clean}⇢${VCS_STATUS_PUSH_COMMITS_AHEAD}"
    # *42 if have stashes.
    (( VCS_STATUS_STASHES        )) && res+=" ${clean}*${VCS_STATUS_STASHES}"
    # 'merge' if the repo is in an unusual state.
    [[ -n $VCS_STATUS_ACTION     ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}"
    # ~42 if have merge conflicts.
    (( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}"
    # +42 if have staged changes.
    (( VCS_STATUS_NUM_STAGED     )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}"
    # !42 if have unstaged changes.
    (( VCS_STATUS_NUM_UNSTAGED   )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}"
    # ?42 if have untracked files. It's really a question mark, your font isn't broken.
    # See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon.
    # Remove the next line if you don't want to see untracked files at all.
    (( VCS_STATUS_NUM_UNTRACKED  )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}${VCS_STATUS_NUM_UNTRACKED}"
    # "─" if the number of unstaged files is unknown. This can happen due to
    # POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower
    # than the number of files in the Git index, or due to bash.showDirtyState being set to false
    # in the repository config. The number of staged and untracked files may also be unknown
    # in this case.
    (( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}─"

    typeset -g my_git_format=$res
  }
  functions -M my_git_formatter 2>/dev/null

  # Don't count the number of unstaged, untracked and conflicted files in Git repositories with
  # more than this many files in the index. Negative value means infinity.
  #
  # If you are working in Git repositories with tens of millions of files and seeing performance
  # sagging, try setting POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY to a number lower than the output
  # of `git ls-files | wc -l`. Alternatively, add `bash.showDirtyState = false` to the repository's
  # config: `git config bash.showDirtyState false`.
  typeset -g POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY=-1

  # Don't show Git status in prompt for repositories whose workdir matches this pattern.
  # For example, if set to '~', the Git repository at $HOME/.git will be ignored.
  # Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'.
  typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'

  # Disable the default Git status formatting.
  typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true
  # Install our own Git status formatter.
  typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${$((my_git_formatter()))+${my_git_format}}'
  # Enable counters for staged, unstaged, etc.
  typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED,CONFLICTED,COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=-1

  # Custom icon.
  # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # Custom prefix.
  # typeset -g POWERLEVEL9K_VCS_PREFIX='on '

  # Show status of repositories of these types. You can add svn and/or hg if you are
  # using them. If you do, your prompt may become slow even when your current directory
  # isn't in an svn or hg repository.
  typeset -g POWERLEVEL9K_VCS_BACKENDS=(git)

  ##########################[ status: exit code of the last command ]###########################
  # Enable OK_PIPE, ERROR_PIPE and ERROR_SIGNAL status states to allow us to enable, disable and
  # style them independently from the regular OK and ERROR state.
  typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true

  # Status on success. No content, just an icon. No need to show it if prompt_char is enabled as
  # it will signify success by turning green.
  typeset -g POWERLEVEL9K_STATUS_OK=true
  typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION='✔'
  typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=2
  typeset -g POWERLEVEL9K_STATUS_OK_BACKGROUND=0

  # Status when some part of a pipe command fails but the overall exit status is zero. It may look
  # like this: 1|0.
  typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true
  typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔'
  typeset -g POWERLEVEL9K_STATUS_OK_PIPE_FOREGROUND=2
  typeset -g POWERLEVEL9K_STATUS_OK_PIPE_BACKGROUND=0

  # Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as
  # it will signify error by turning red.
  typeset -g POWERLEVEL9K_STATUS_ERROR=true
  typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘'
  typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=3
  typeset -g POWERLEVEL9K_STATUS_ERROR_BACKGROUND=1

  # Status when the last command was terminated by a signal.
  typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true
  # Use terse signal names: "INT" instead of "SIGINT(2)".
  typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false
  typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘'
  typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_FOREGROUND=3
  typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_BACKGROUND=1

  # Status when some part of a pipe command fails and the overall exit status is also non-zero.
  # It may look like this: 1|0.
  typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true
  typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘'
  typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_FOREGROUND=3
  typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_BACKGROUND=1

  ###################[ command_execution_time: duration of the last command ]###################
  # Execution time color.
  typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=0
  typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND=3
  # Show duration of the last command if takes at least this many seconds.
  typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=3
  # Show this many fractional digits. Zero means round to seconds.
  typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
  # Duration format: 1d 2h 3m 4s.
  typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
  # Custom icon.
  # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # Custom prefix.
  # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='took '

  #######################[ background_jobs: presence of background jobs ]#######################
  # Background jobs color.
  typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=6
  typeset -g POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND=0
  # Don't show the number of background jobs.
  typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false
  # Custom icon.
  # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #######################[ direnv: direnv status (https://direnv.net/) ]########################
  # Direnv color.
  typeset -g POWERLEVEL9K_DIRENV_FOREGROUND=3
  typeset -g POWERLEVEL9K_DIRENV_BACKGROUND=0
  # Custom icon.
  # typeset -g POWERLEVEL9K_DIRENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ###############[ asdf: asdf version manager (https://github.com/asdf-vm/asdf) ]###############
  # Default asdf color. Only used to display tools for which there is no color override (see below).
  # Tip:  Override these parameters for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_FOREGROUND and
  # POWERLEVEL9K_ASDF_${TOOL}_BACKGROUND.
  typeset -g POWERLEVEL9K_ASDF_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_BACKGROUND=7

  # There are four parameters that can be used to hide asdf tools. Each parameter describes
  # conditions under which a tool gets hidden. Parameters can hide tools but not unhide them. If at
  # least one parameter decides to hide a tool, that tool gets hidden. If no parameter decides to
  # hide a tool, it gets shown.
  #
  # Special note on the difference between POWERLEVEL9K_ASDF_SOURCES and
  # POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW. Consider the effect of the following commands:
  #
  #   asdf local  python 3.8.1
  #   asdf global python 3.8.1
  #
  # After running both commands the current python version is 3.8.1 and its source is "local" as
  # it takes precedence over "global". If POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW is set to false,
  # it'll hide python version in this case because 3.8.1 is the same as the global version.
  # POWERLEVEL9K_ASDF_SOURCES will hide python version only if the value of this parameter doesn't
  # contain "local".

  # Hide tool versions that don't come from one of these sources.
  #
  # Available sources:
  #
  # - shell   `asdf current` says "set by ASDF_${TOOL}_VERSION environment variable"
  # - local   `asdf current` says "set by /some/not/home/directory/file"
  # - global  `asdf current` says "set by /home/username/file"
  #
  # Note: If this parameter is set to (shell local global), it won't hide tools.
  # Tip:  Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SOURCES.
  typeset -g POWERLEVEL9K_ASDF_SOURCES=(shell local global)

  # If set to false, hide tool versions that are the same as global.
  #
  # Note: The name of this parameter doesn't reflect its meaning at all.
  # Note: If this parameter is set to true, it won't hide tools.
  # Tip:  Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_PROMPT_ALWAYS_SHOW.
  typeset -g POWERLEVEL9K_ASDF_PROMPT_ALWAYS_SHOW=false

  # If set to false, hide tool versions that are equal to "system".
  #
  # Note: If this parameter is set to true, it won't hide tools.
  # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_SYSTEM.
  typeset -g POWERLEVEL9K_ASDF_SHOW_SYSTEM=true

  # If set to non-empty value, hide tools unless there is a file matching the specified file pattern
  # in the current directory, or its parent directory, or its grandparent directory, and so on.
  #
  # Note: If this parameter is set to empty value, it won't hide tools.
  # Note: SHOW_ON_UPGLOB isn't specific to asdf. It works with all prompt segments.
  # Tip: Override this parameter for ${TOOL} with POWERLEVEL9K_ASDF_${TOOL}_SHOW_ON_UPGLOB.
  #
  # Example: Hide nodejs version when there is no package.json and no *.js files in the current
  # directory, in `..`, in `../..` and so on.
  #
  #   typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.js|package.json'
  typeset -g POWERLEVEL9K_ASDF_SHOW_ON_UPGLOB=

  # Ruby version from asdf.
  typeset -g POWERLEVEL9K_ASDF_RUBY_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_RUBY_BACKGROUND=1
  # typeset -g POWERLEVEL9K_ASDF_RUBY_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_RUBY_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Python version from asdf.
  typeset -g POWERLEVEL9K_ASDF_PYTHON_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_PYTHON_BACKGROUND=4
  # typeset -g POWERLEVEL9K_ASDF_PYTHON_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_PYTHON_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Go version from asdf.
  typeset -g POWERLEVEL9K_ASDF_GOLANG_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_GOLANG_BACKGROUND=4
  # typeset -g POWERLEVEL9K_ASDF_GOLANG_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_GOLANG_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Node.js version from asdf.
  typeset -g POWERLEVEL9K_ASDF_NODEJS_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_NODEJS_BACKGROUND=2
  # typeset -g POWERLEVEL9K_ASDF_NODEJS_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_NODEJS_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Rust version from asdf.
  typeset -g POWERLEVEL9K_ASDF_RUST_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_RUST_BACKGROUND=208
  # typeset -g POWERLEVEL9K_ASDF_RUST_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_RUST_SHOW_ON_UPGLOB='*.foo|*.bar'

  # .NET Core version from asdf.
  typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_BACKGROUND=5
  # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Flutter version from asdf.
  typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_FLUTTER_BACKGROUND=4
  # typeset -g POWERLEVEL9K_ASDF_FLUTTER_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_FLUTTER_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Lua version from asdf.
  typeset -g POWERLEVEL9K_ASDF_LUA_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_LUA_BACKGROUND=4
  # typeset -g POWERLEVEL9K_ASDF_LUA_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_LUA_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Java version from asdf.
  typeset -g POWERLEVEL9K_ASDF_JAVA_FOREGROUND=1
  typeset -g POWERLEVEL9K_ASDF_JAVA_BACKGROUND=7
  # typeset -g POWERLEVEL9K_ASDF_JAVA_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_JAVA_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Perl version from asdf.
  typeset -g POWERLEVEL9K_ASDF_PERL_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_PERL_BACKGROUND=4
  # typeset -g POWERLEVEL9K_ASDF_PERL_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_PERL_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Erlang version from asdf.
  typeset -g POWERLEVEL9K_ASDF_ERLANG_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_ERLANG_BACKGROUND=1
  # typeset -g POWERLEVEL9K_ASDF_ERLANG_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_ERLANG_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Elixir version from asdf.
  typeset -g POWERLEVEL9K_ASDF_ELIXIR_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_ELIXIR_BACKGROUND=5
  # typeset -g POWERLEVEL9K_ASDF_ELIXIR_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_ELIXIR_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Postgres version from asdf.
  typeset -g POWERLEVEL9K_ASDF_POSTGRES_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_POSTGRES_BACKGROUND=6
  # typeset -g POWERLEVEL9K_ASDF_POSTGRES_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_POSTGRES_SHOW_ON_UPGLOB='*.foo|*.bar'

  # PHP version from asdf.
  typeset -g POWERLEVEL9K_ASDF_PHP_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_PHP_BACKGROUND=5
  # typeset -g POWERLEVEL9K_ASDF_PHP_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_PHP_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Haskell version from asdf.
  typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_HASKELL_BACKGROUND=3
  # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar'

  # Julia version from asdf.
  typeset -g POWERLEVEL9K_ASDF_JULIA_FOREGROUND=0
  typeset -g POWERLEVEL9K_ASDF_JULIA_BACKGROUND=2
  # typeset -g POWERLEVEL9K_ASDF_JULIA_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_ASDF_JULIA_SHOW_ON_UPGLOB='*.foo|*.bar'

  ##########[ nordvpn: nordvpn connection status, linux only (https://nordvpn.com/) ]###########
  # NordVPN connection indicator color.
  typeset -g POWERLEVEL9K_NORDVPN_FOREGROUND=7
  typeset -g POWERLEVEL9K_NORDVPN_BACKGROUND=4
  # Hide NordVPN connection indicator when not connected.
  typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_CONTENT_EXPANSION=
  typeset -g POWERLEVEL9K_NORDVPN_{DISCONNECTED,CONNECTING,DISCONNECTING}_VISUAL_IDENTIFIER_EXPANSION=
  # Custom icon.
  # typeset -g POWERLEVEL9K_NORDVPN_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #################[ ranger: ranger shell (https://github.com/ranger/ranger) ]##################
  # Ranger shell color.
  typeset -g POWERLEVEL9K_RANGER_FOREGROUND=3
  typeset -g POWERLEVEL9K_RANGER_BACKGROUND=0
  # Custom icon.
  # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]#######################
  # Nnn shell color.
  typeset -g POWERLEVEL9K_NNN_FOREGROUND=0
  typeset -g POWERLEVEL9K_NNN_BACKGROUND=6
  # Custom icon.
  # typeset -g POWERLEVEL9K_NNN_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ######################[ lf: lf shell (https://github.com/gokcehan/lf) ]#######################
  # lf shell color.
  typeset -g POWERLEVEL9K_LF_FOREGROUND=0
  typeset -g POWERLEVEL9K_LF_BACKGROUND=6
  # Custom icon.
  # typeset -g POWERLEVEL9K_LF_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##################[ xplr: xplr shell (https://github.com/sayanarijit/xplr) ]##################
  # xplr shell color.
  typeset -g POWERLEVEL9K_XPLR_FOREGROUND=0
  typeset -g POWERLEVEL9K_XPLR_BACKGROUND=6
  # Custom icon.
  # typeset -g POWERLEVEL9K_XPLR_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ###########################[ vim_shell: vim shell indicator (:sh) ]###########################
  # Vim shell indicator color.
  typeset -g POWERLEVEL9K_VIM_SHELL_FOREGROUND=0
  typeset -g POWERLEVEL9K_VIM_SHELL_BACKGROUND=2
  # Custom icon.
  # typeset -g POWERLEVEL9K_VIM_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ######[ midnight_commander: midnight commander shell (https://midnight-commander.org/) ]######
  # Midnight Commander shell color.
  typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_FOREGROUND=3
  typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_BACKGROUND=0
  # Custom icon.
  # typeset -g POWERLEVEL9K_MIDNIGHT_COMMANDER_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #[ nix_shell: nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) ]##
  # Nix shell color.
  typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=0
  typeset -g POWERLEVEL9K_NIX_SHELL_BACKGROUND=4

  # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store.
  # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false

  # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line.
  # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION=

  # Custom icon.
  # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]##################
  # chezmoi shell color.
  typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=0
  typeset -g POWERLEVEL9K_CHEZMOI_SHELL_BACKGROUND=4
  # Custom icon.
  # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##################################[ disk_usage: disk usage ]##################################
  # Colors for different levels of disk usage.
  typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=3
  typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_BACKGROUND=0
  typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_FOREGROUND=0
  typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_BACKGROUND=3
  typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_FOREGROUND=7
  typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_BACKGROUND=1
  # Thresholds for different levels of disk usage (percentage points).
  typeset -g POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90
  typeset -g POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95
  # If set to true, hide disk usage when below $POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL percent.
  typeset -g POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false
  # Custom icon.
  # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]###########
  # Foreground color.
  typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0
  # Text and color for normal (a.k.a. command) vi mode.
  typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL
  typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2
  # Text and color for visual vi mode.
  typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL
  typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4
  # Text and color for overtype (a.k.a. overwrite and replace) vi mode.
  typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE
  typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3
  # Text and color for insert vi mode.
  typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING=
  typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8

  ######################################[ ram: free RAM ]#######################################
  # RAM color.
  typeset -g POWERLEVEL9K_RAM_FOREGROUND=0
  typeset -g POWERLEVEL9K_RAM_BACKGROUND=3
  # Custom icon.
  # typeset -g POWERLEVEL9K_RAM_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #####################################[ swap: used swap ]######################################
  # Swap color.
  typeset -g POWERLEVEL9K_SWAP_FOREGROUND=0
  typeset -g POWERLEVEL9K_SWAP_BACKGROUND=3
  # Custom icon.
  # typeset -g POWERLEVEL9K_SWAP_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ######################################[ load: CPU load ]######################################
  # Show average CPU load over this many last minutes. Valid values are 1, 5 and 15.
  typeset -g POWERLEVEL9K_LOAD_WHICH=5
  # Load color when load is under 50%.
  typeset -g POWERLEVEL9K_LOAD_NORMAL_FOREGROUND=0
  typeset -g POWERLEVEL9K_LOAD_NORMAL_BACKGROUND=2
  # Load color when load is between 50% and 70%.
  typeset -g POWERLEVEL9K_LOAD_WARNING_FOREGROUND=0
  typeset -g POWERLEVEL9K_LOAD_WARNING_BACKGROUND=3
  # Load color when load is over 70%.
  typeset -g POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND=0
  typeset -g POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND=1
  # Custom icon.
  # typeset -g POWERLEVEL9K_LOAD_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ################[ todo: todo items (https://github.com/todotxt/todo.txt-cli) ]################
  # Todo color.
  typeset -g POWERLEVEL9K_TODO_FOREGROUND=0
  typeset -g POWERLEVEL9K_TODO_BACKGROUND=8
  # Hide todo when the total number of tasks is zero.
  typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_TOTAL=true
  # Hide todo when the number of tasks after filtering is zero.
  typeset -g POWERLEVEL9K_TODO_HIDE_ZERO_FILTERED=false

  # Todo format. The following parameters are available within the expansion.
  #
  # - P9K_TODO_TOTAL_TASK_COUNT     The total number of tasks.
  # - P9K_TODO_FILTERED_TASK_COUNT  The number of tasks after filtering.
  #
  # These variables correspond to the last line of the output of `todo.sh -p ls`:
  #
  #   TODO: 24 of 42 tasks shown
  #
  # Here 24 is P9K_TODO_FILTERED_TASK_COUNT and 42 is P9K_TODO_TOTAL_TASK_COUNT.
  #
  # typeset -g POWERLEVEL9K_TODO_CONTENT_EXPANSION='$P9K_TODO_FILTERED_TASK_COUNT'

  # Custom icon.
  # typeset -g POWERLEVEL9K_TODO_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ###########[ timewarrior: timewarrior tracking status (https://timewarrior.net/) ]############
  # Timewarrior color.
  typeset -g POWERLEVEL9K_TIMEWARRIOR_FOREGROUND=255
  typeset -g POWERLEVEL9K_TIMEWARRIOR_BACKGROUND=8

  # If the tracked task is longer than 24 characters, truncate and append "...".
  # Tip: To always display tasks without truncation, delete the following parameter.
  # Tip: To hide task names and display just the icon when time tracking is enabled, set the
  # value of the following parameter to "".
  typeset -g POWERLEVEL9K_TIMEWARRIOR_CONTENT_EXPANSION='${P9K_CONTENT:0:24}${${P9K_CONTENT:24}:+...}'

  # Custom icon.
  # typeset -g POWERLEVEL9K_TIMEWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##############[ taskwarrior: taskwarrior task count (https://taskwarrior.org/) ]##############
  # Taskwarrior color.
  typeset -g POWERLEVEL9K_TASKWARRIOR_FOREGROUND=0
  typeset -g POWERLEVEL9K_TASKWARRIOR_BACKGROUND=6

  # Taskwarrior segment format. The following parameters are available within the expansion.
  #
  # - P9K_TASKWARRIOR_PENDING_COUNT   The number of pending tasks: `task +PENDING count`.
  # - P9K_TASKWARRIOR_OVERDUE_COUNT   The number of overdue tasks: `task +OVERDUE count`.
  #
  # Zero values are represented as empty parameters.
  #
  # The default format:
  #
  #   '${P9K_TASKWARRIOR_OVERDUE_COUNT:+"!$P9K_TASKWARRIOR_OVERDUE_COUNT/"}$P9K_TASKWARRIOR_PENDING_COUNT'
  #
  # typeset -g POWERLEVEL9K_TASKWARRIOR_CONTENT_EXPANSION='$P9K_TASKWARRIOR_PENDING_COUNT'

  # Custom icon.
  # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]#######
  # Color when using local/global history.
  typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=0
  typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_BACKGROUND=5
  typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=0
  typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_BACKGROUND=3

  # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon.
  # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION=''
  # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION=''

  # Custom icon.
  # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ################################[ cpu_arch: CPU architecture ]################################
  # CPU architecture color.
  typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=0
  typeset -g POWERLEVEL9K_CPU_ARCH_BACKGROUND=3

  # Hide the segment when on a specific CPU architecture.
  # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_CONTENT_EXPANSION=
  # typeset -g POWERLEVEL9K_CPU_ARCH_X86_64_VISUAL_IDENTIFIER_EXPANSION=

  # Custom icon.
  # typeset -g POWERLEVEL9K_CPU_ARCH_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##################################[ context: user@hostname ]##################################
  # Context color when running with privileges.
  typeset -g POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND=1
  typeset -g POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND=0
  # Context color in SSH without privileges.
  typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_FOREGROUND=3
  typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_BACKGROUND=0
  # Default context color (no privileges, no SSH).
  typeset -g POWERLEVEL9K_CONTEXT_FOREGROUND=3
  typeset -g POWERLEVEL9K_CONTEXT_BACKGROUND=0

  # Context format when running with privileges: user@hostname.
  typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE='%n@%m'
  # Context format when in SSH without privileges: user@hostname.
  typeset -g POWERLEVEL9K_CONTEXT_{REMOTE,REMOTE_SUDO}_TEMPLATE='%n@%m'
  # Default context format (no privileges, no SSH): user@hostname.
  typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE='%n@%m'

  # Don't show context unless running with privileges or in SSH.
  # Tip: Remove the next line to always show context.
  typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_{CONTENT,VISUAL_IDENTIFIER}_EXPANSION=

  # Custom icon.
  # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # Custom prefix.
  # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='with '

  ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]###
  # Python virtual environment color.
  typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=0
  typeset -g POWERLEVEL9K_VIRTUALENV_BACKGROUND=4
  # Don't show Python version next to the virtual environment name.
  typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
  # If set to "false", won't show virtualenv if pyenv is already shown.
  # If set to "if-different", won't show virtualenv if it's the same as pyenv.
  typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_PYENV=false
  # Separate environment name from Python version only with a space.
  typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
  # Custom icon.
  # typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #####################[ anaconda: conda environment (https://conda.io/) ]######################
  # Anaconda environment color.
  typeset -g POWERLEVEL9K_ANACONDA_FOREGROUND=0
  typeset -g POWERLEVEL9K_ANACONDA_BACKGROUND=4

  # Anaconda segment format. The following parameters are available within the expansion.
  #
  # - CONDA_PREFIX                 Absolute path to the active Anaconda/Miniconda environment.
  # - CONDA_DEFAULT_ENV            Name of the active Anaconda/Miniconda environment.
  # - CONDA_PROMPT_MODIFIER        Configurable prompt modifier (see below).
  # - P9K_ANACONDA_PYTHON_VERSION  Current python version (python --version).
  #
  # CONDA_PROMPT_MODIFIER can be configured with the following command:
  #
  #   conda config --set env_prompt '({default_env}) '
  #
  # The last argument is a Python format string that can use the following variables:
  #
  # - prefix       The same as CONDA_PREFIX.
  # - default_env  The same as CONDA_DEFAULT_ENV.
  # - name         The last segment of CONDA_PREFIX.
  # - stacked_env  Comma-separated list of names in the environment stack. The first element is
  #                always the same as default_env.
  #
  # Note: '({default_env}) ' is the default value of env_prompt.
  #
  # The default value of POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION expands to $CONDA_PROMPT_MODIFIER
  # without the surrounding parentheses, or to the last path component of CONDA_PREFIX if the former
  # is empty.
  typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}'

  # Custom icon.
  # typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################
  # Pyenv color.
  typeset -g POWERLEVEL9K_PYENV_FOREGROUND=0
  typeset -g POWERLEVEL9K_PYENV_BACKGROUND=4
  # Hide python version if it doesn't come from one of these sources.
  typeset -g POWERLEVEL9K_PYENV_SOURCES=(shell local global)
  # If set to false, hide python version if it's the same as global:
  # $(pyenv version-name) == $(pyenv global).
  typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
  # If set to false, hide python version if it's equal to "system".
  typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true

  # Pyenv segment format. The following parameters are available within the expansion.
  #
  # - P9K_CONTENT                Current pyenv environment (pyenv version-name).
  # - P9K_PYENV_PYTHON_VERSION   Current python version (python --version).
  #
  # The default format has the following logic:
  #
  # 1. Display just "$P9K_CONTENT" if it's equal to "$P9K_PYENV_PYTHON_VERSION" or
  #    starts with "$P9K_PYENV_PYTHON_VERSION/".
  # 2. Otherwise display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION".
  typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}'

  # Custom icon.
  # typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ################[ goenv: go environment (https://github.com/syndbg/goenv) ]################
  # Goenv color.
  typeset -g POWERLEVEL9K_GOENV_FOREGROUND=0
  typeset -g POWERLEVEL9K_GOENV_BACKGROUND=4
  # Hide go version if it doesn't come from one of these sources.
  typeset -g POWERLEVEL9K_GOENV_SOURCES=(shell local global)
  # If set to false, hide go version if it's the same as global:
  # $(goenv version-name) == $(goenv global).
  typeset -g POWERLEVEL9K_GOENV_PROMPT_ALWAYS_SHOW=false
  # If set to false, hide go version if it's equal to "system".
  typeset -g POWERLEVEL9K_GOENV_SHOW_SYSTEM=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_GOENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##########[ nodenv: node.js version from nodenv (https://github.com/nodenv/nodenv) ]##########
  # Nodenv color.
  typeset -g POWERLEVEL9K_NODENV_FOREGROUND=2
  typeset -g POWERLEVEL9K_NODENV_BACKGROUND=0
  # Hide node version if it doesn't come from one of these sources.
  typeset -g POWERLEVEL9K_NODENV_SOURCES=(shell local global)
  # If set to false, hide node version if it's the same as global:
  # $(nodenv version-name) == $(nodenv global).
  typeset -g POWERLEVEL9K_NODENV_PROMPT_ALWAYS_SHOW=false
  # If set to false, hide node version if it's equal to "system".
  typeset -g POWERLEVEL9K_NODENV_SHOW_SYSTEM=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_NODENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]###############
  # Nvm color.
  typeset -g POWERLEVEL9K_NVM_FOREGROUND=0
  typeset -g POWERLEVEL9K_NVM_BACKGROUND=5
  # If set to false, hide node version if it's the same as default:
  # $(nvm version current) == $(nvm version default).
  typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false
  # If set to false, hide node version if it's equal to "system".
  typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ############[ nodeenv: node.js environment (https://github.com/ekalinin/nodeenv) ]############
  # Nodeenv color.
  typeset -g POWERLEVEL9K_NODEENV_FOREGROUND=2
  typeset -g POWERLEVEL9K_NODEENV_BACKGROUND=0
  # Don't show Node version next to the environment name.
  typeset -g POWERLEVEL9K_NODEENV_SHOW_NODE_VERSION=false
  # Separate environment name from Node version only with a space.
  typeset -g POWERLEVEL9K_NODEENV_{LEFT,RIGHT}_DELIMITER=
  # Custom icon.
  # typeset -g POWERLEVEL9K_NODEENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##############################[ node_version: node.js version ]###############################
  # Node version color.
  typeset -g POWERLEVEL9K_NODE_VERSION_FOREGROUND=7
  typeset -g POWERLEVEL9K_NODE_VERSION_BACKGROUND=2
  # Show node version only when in a directory tree containing package.json.
  typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_NODE_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #######################[ go_version: go version (https://golang.org) ]########################
  # Go version color.
  typeset -g POWERLEVEL9K_GO_VERSION_FOREGROUND=255
  typeset -g POWERLEVEL9K_GO_VERSION_BACKGROUND=2
  # Show go version only when in a go project subdirectory.
  typeset -g POWERLEVEL9K_GO_VERSION_PROJECT_ONLY=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_GO_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #################[ rust_version: rustc version (https://www.rust-lang.org) ]##################
  # Rust version color.
  typeset -g POWERLEVEL9K_RUST_VERSION_FOREGROUND=0
  typeset -g POWERLEVEL9K_RUST_VERSION_BACKGROUND=208
  # Show rust version only when in a rust project subdirectory.
  typeset -g POWERLEVEL9K_RUST_VERSION_PROJECT_ONLY=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_RUST_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ###############[ dotnet_version: .NET version (https://dotnet.microsoft.com) ]################
  # .NET version color.
  typeset -g POWERLEVEL9K_DOTNET_VERSION_FOREGROUND=7
  typeset -g POWERLEVEL9K_DOTNET_VERSION_BACKGROUND=5
  # Show .NET version only when in a .NET project subdirectory.
  typeset -g POWERLEVEL9K_DOTNET_VERSION_PROJECT_ONLY=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_DOTNET_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #####################[ php_version: php version (https://www.php.net/) ]######################
  # PHP version color.
  typeset -g POWERLEVEL9K_PHP_VERSION_FOREGROUND=0
  typeset -g POWERLEVEL9K_PHP_VERSION_BACKGROUND=5
  # Show PHP version only when in a PHP project subdirectory.
  typeset -g POWERLEVEL9K_PHP_VERSION_PROJECT_ONLY=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_PHP_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##########[ laravel_version: laravel php framework version (https://laravel.com/) ]###########
  # Laravel version color.
  typeset -g POWERLEVEL9K_LARAVEL_VERSION_FOREGROUND=1
  typeset -g POWERLEVEL9K_LARAVEL_VERSION_BACKGROUND=7
  # Custom icon.
  # typeset -g POWERLEVEL9K_LARAVEL_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #############[ rbenv: ruby version from rbenv (https://github.com/rbenv/rbenv) ]##############
  # Rbenv color.
  typeset -g POWERLEVEL9K_RBENV_FOREGROUND=0
  typeset -g POWERLEVEL9K_RBENV_BACKGROUND=1
  # Hide ruby version if it doesn't come from one of these sources.
  typeset -g POWERLEVEL9K_RBENV_SOURCES=(shell local global)
  # If set to false, hide ruby version if it's the same as global:
  # $(rbenv version-name) == $(rbenv global).
  typeset -g POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW=false
  # If set to false, hide ruby version if it's equal to "system".
  typeset -g POWERLEVEL9K_RBENV_SHOW_SYSTEM=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_RBENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ####################[ java_version: java version (https://www.java.com/) ]####################
  # Java version color.
  typeset -g POWERLEVEL9K_JAVA_VERSION_FOREGROUND=1
  typeset -g POWERLEVEL9K_JAVA_VERSION_BACKGROUND=7
  # Show java version only when in a java project subdirectory.
  typeset -g POWERLEVEL9K_JAVA_VERSION_PROJECT_ONLY=true
  # Show brief version.
  typeset -g POWERLEVEL9K_JAVA_VERSION_FULL=false
  # Custom icon.
  # typeset -g POWERLEVEL9K_JAVA_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ###[ package: name@version from package.json (https://docs.npmjs.com/files/package.json) ]####
  # Package color.
  typeset -g POWERLEVEL9K_PACKAGE_FOREGROUND=0
  typeset -g POWERLEVEL9K_PACKAGE_BACKGROUND=6

  # Package format. The following parameters are available within the expansion.
  #
  # - P9K_PACKAGE_NAME     The value of `name` field in package.json.
  # - P9K_PACKAGE_VERSION  The value of `version` field in package.json.
  #
  # typeset -g POWERLEVEL9K_PACKAGE_CONTENT_EXPANSION='${P9K_PACKAGE_NAME//\%/%%}@${P9K_PACKAGE_VERSION//\%/%%}'

  # Custom icon.
  # typeset -g POWERLEVEL9K_PACKAGE_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #######################[ rvm: ruby version from rvm (https://rvm.io) ]########################
  # Rvm color.
  typeset -g POWERLEVEL9K_RVM_FOREGROUND=0
  typeset -g POWERLEVEL9K_RVM_BACKGROUND=240
  # Don't show @gemset at the end.
  typeset -g POWERLEVEL9K_RVM_SHOW_GEMSET=false
  # Don't show ruby- at the front.
  typeset -g POWERLEVEL9K_RVM_SHOW_PREFIX=false
  # Custom icon.
  # typeset -g POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ###########[ fvm: flutter version management (https://github.com/leoafarias/fvm) ]############
  # Fvm color.
  typeset -g POWERLEVEL9K_FVM_FOREGROUND=0
  typeset -g POWERLEVEL9K_FVM_BACKGROUND=4
  # Custom icon.
  # typeset -g POWERLEVEL9K_FVM_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##########[ luaenv: lua version from luaenv (https://github.com/cehoffman/luaenv) ]###########
  # Lua color.
  typeset -g POWERLEVEL9K_LUAENV_FOREGROUND=0
  typeset -g POWERLEVEL9K_LUAENV_BACKGROUND=4
  # Hide lua version if it doesn't come from one of these sources.
  typeset -g POWERLEVEL9K_LUAENV_SOURCES=(shell local global)
  # If set to false, hide lua version if it's the same as global:
  # $(luaenv version-name) == $(luaenv global).
  typeset -g POWERLEVEL9K_LUAENV_PROMPT_ALWAYS_SHOW=false
  # If set to false, hide lua version if it's equal to "system".
  typeset -g POWERLEVEL9K_LUAENV_SHOW_SYSTEM=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_LUAENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ###############[ jenv: java version from jenv (https://github.com/jenv/jenv) ]################
  # Java color.
  typeset -g POWERLEVEL9K_JENV_FOREGROUND=1
  typeset -g POWERLEVEL9K_JENV_BACKGROUND=7
  # Hide java version if it doesn't come from one of these sources.
  typeset -g POWERLEVEL9K_JENV_SOURCES=(shell local global)
  # If set to false, hide java version if it's the same as global:
  # $(jenv version-name) == $(jenv global).
  typeset -g POWERLEVEL9K_JENV_PROMPT_ALWAYS_SHOW=false
  # If set to false, hide java version if it's equal to "system".
  typeset -g POWERLEVEL9K_JENV_SHOW_SYSTEM=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_JENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ###########[ plenv: perl version from plenv (https://github.com/tokuhirom/plenv) ]############
  # Perl color.
  typeset -g POWERLEVEL9K_PLENV_FOREGROUND=0
  typeset -g POWERLEVEL9K_PLENV_BACKGROUND=4
  # Hide perl version if it doesn't come from one of these sources.
  typeset -g POWERLEVEL9K_PLENV_SOURCES=(shell local global)
  # If set to false, hide perl version if it's the same as global:
  # $(plenv version-name) == $(plenv global).
  typeset -g POWERLEVEL9K_PLENV_PROMPT_ALWAYS_SHOW=false
  # If set to false, hide perl version if it's equal to "system".
  typeset -g POWERLEVEL9K_PLENV_SHOW_SYSTEM=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_PLENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ###########[ perlbrew: perl version from perlbrew (https://github.com/gugod/App-perlbrew) ]############
  # Perlbrew color.
  typeset -g POWERLEVEL9K_PERLBREW_FOREGROUND=67
  # Show perlbrew version only when in a perl project subdirectory.
  typeset -g POWERLEVEL9K_PERLBREW_PROJECT_ONLY=true
  # Don't show "perl-" at the front.
  typeset -g POWERLEVEL9K_PERLBREW_SHOW_PREFIX=false
  # Custom icon.
  # typeset -g POWERLEVEL9K_PERLBREW_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ############[ phpenv: php version from phpenv (https://github.com/phpenv/phpenv) ]############
  # PHP color.
  typeset -g POWERLEVEL9K_PHPENV_FOREGROUND=0
  typeset -g POWERLEVEL9K_PHPENV_BACKGROUND=5
  # Hide php version if it doesn't come from one of these sources.
  typeset -g POWERLEVEL9K_PHPENV_SOURCES=(shell local global)
  # If set to false, hide php version if it's the same as global:
  # $(phpenv version-name) == $(phpenv global).
  typeset -g POWERLEVEL9K_PHPENV_PROMPT_ALWAYS_SHOW=false
  # If set to false, hide PHP version if it's equal to "system".
  typeset -g POWERLEVEL9K_PHPENV_SHOW_SYSTEM=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_PHPENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #######[ scalaenv: scala version from scalaenv (https://github.com/scalaenv/scalaenv) ]#######
  # Scala color.
  typeset -g POWERLEVEL9K_SCALAENV_FOREGROUND=0
  typeset -g POWERLEVEL9K_SCALAENV_BACKGROUND=1
  # Hide scala version if it doesn't come from one of these sources.
  typeset -g POWERLEVEL9K_SCALAENV_SOURCES=(shell local global)
  # If set to false, hide scala version if it's the same as global:
  # $(scalaenv version-name) == $(scalaenv global).
  typeset -g POWERLEVEL9K_SCALAENV_PROMPT_ALWAYS_SHOW=false
  # If set to false, hide scala version if it's equal to "system".
  typeset -g POWERLEVEL9K_SCALAENV_SHOW_SYSTEM=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_SCALAENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##########[ haskell_stack: haskell version from stack (https://haskellstack.org/) ]###########
  # Haskell color.
  typeset -g POWERLEVEL9K_HASKELL_STACK_FOREGROUND=0
  typeset -g POWERLEVEL9K_HASKELL_STACK_BACKGROUND=3

  # Hide haskell version if it doesn't come from one of these sources.
  #
  #   shell:  version is set by STACK_YAML
  #   local:  version is set by stack.yaml up the directory tree
  #   global: version is set by the implicit global project (~/.stack/global-project/stack.yaml)
  typeset -g POWERLEVEL9K_HASKELL_STACK_SOURCES=(shell local)
  # If set to false, hide haskell version if it's the same as in the implicit global project.
  typeset -g POWERLEVEL9K_HASKELL_STACK_ALWAYS_SHOW=true
  # Custom icon.
  # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ################[ terraform: terraform workspace (https://www.terraform.io) ]#################
  # Don't show terraform workspace if it's literally "default".
  typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false
  # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element
  # in each pair defines a pattern against which the current terraform workspace gets matched.
  # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
  # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters,
  # you'll see this value in your prompt. The second element of each pair in
  # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The
  # first match wins.
  #
  # For example, given these settings:
  #
  #   typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
  #     '*prod*'  PROD
  #     '*test*'  TEST
  #     '*'       OTHER)
  #
  # If your current terraform workspace is "project_test", its class is TEST because "project_test"
  # doesn't match the pattern '*prod*' but does match '*test*'.
  #
  # You can define different colors, icons and content expansions for different classes:
  #
  #   typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=2
  #   typeset -g POWERLEVEL9K_TERRAFORM_TEST_BACKGROUND=0
  #   typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
  #   typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
  typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=(
      # '*prod*'  PROD    # These values are examples that are unlikely
      # '*test*'  TEST    # to match your needs. Customize them as needed.
      '*'         OTHER)
  typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=4
  typeset -g POWERLEVEL9K_TERRAFORM_OTHER_BACKGROUND=0
  # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #############[ terraform_version: terraform version (https://www.terraform.io) ]##############
  # Terraform version color.
  typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=4
  typeset -g POWERLEVEL9K_TERRAFORM_VERSION_BACKGROUND=0
  # Custom icon.
  # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ################[ terraform_version: It shows active terraform version (https://www.terraform.io) ]#################
  typeset -g POWERLEVEL9K_TERRAFORM_VERSION_SHOW_ON_COMMAND='terraform|tf'

  #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]#############
  # Show kubecontext only when the command you are typing invokes one of these tools.
  # Tip: Remove the next line to always show kubecontext.
  typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl'

  # Kubernetes context classes for the purpose of using different colors, icons and expansions with
  # different contexts.
  #
  # POWERLEVEL9K_KUBECONTEXT_CLASSES is an array with even number of elements. The first element
  # in each pair defines a pattern against which the current kubernetes context gets matched.
  # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
  # that gets matched. If you unset all POWERLEVEL9K_KUBECONTEXT_*CONTENT_EXPANSION parameters,
  # you'll see this value in your prompt. The second element of each pair in
  # POWERLEVEL9K_KUBECONTEXT_CLASSES defines the context class. Patterns are tried in order. The
  # first match wins.
  #
  # For example, given these settings:
  #
  #   typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=(
  #     '*prod*'  PROD
  #     '*test*'  TEST
  #     '*'       DEFAULT)
  #
  # If your current kubernetes context is "deathray-testing/default", its class is TEST
  # because "deathray-testing/default" doesn't match the pattern '*prod*' but does match '*test*'.
  #
  # You can define different colors, icons and content expansions for different classes:
  #
  #   typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_FOREGROUND=0
  #   typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_BACKGROUND=2
  #   typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
  #   typeset -g POWERLEVEL9K_KUBECONTEXT_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
  typeset -g POWERLEVEL9K_KUBECONTEXT_CLASSES=(
      # '*prod*'  PROD    # These values are examples that are unlikely
      # '*test*'  TEST    # to match your needs. Customize them as needed.
      '*'       DEFAULT)
  typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_FOREGROUND=7
  typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_BACKGROUND=5
  # typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'

  # Use POWERLEVEL9K_KUBECONTEXT_CONTENT_EXPANSION to specify the content displayed by kubecontext
  # segment. Parameter expansions are very flexible and fast, too. See reference:
  # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion.
  #
  # Within the expansion the following parameters are always available:
  #
  # - P9K_CONTENT                The content that would've been displayed if there was no content
  #                              expansion defined.
  # - P9K_KUBECONTEXT_NAME       The current context's name. Corresponds to column NAME in the
  #                              output of `kubectl config get-contexts`.
  # - P9K_KUBECONTEXT_CLUSTER    The current context's cluster. Corresponds to column CLUSTER in the
  #                              output of `kubectl config get-contexts`.
  # - P9K_KUBECONTEXT_NAMESPACE  The current context's namespace. Corresponds to column NAMESPACE
  #                              in the output of `kubectl config get-contexts`. If there is no
  #                              namespace, the parameter is set to "default".
  # - P9K_KUBECONTEXT_USER       The current context's user. Corresponds to column AUTHINFO in the
  #                              output of `kubectl config get-contexts`.
  #
  # If the context points to Google Kubernetes Engine (GKE) or Elastic Kubernetes Service (EKS),
  # the following extra parameters are available:
  #
  # - P9K_KUBECONTEXT_CLOUD_NAME     Either "gke" or "eks".
  # - P9K_KUBECONTEXT_CLOUD_ACCOUNT  Account/project ID.
  # - P9K_KUBECONTEXT_CLOUD_ZONE     Availability zone.
  # - P9K_KUBECONTEXT_CLOUD_CLUSTER  Cluster.
  #
  # P9K_KUBECONTEXT_CLOUD_* parameters are derived from P9K_KUBECONTEXT_CLUSTER. For example,
  # if P9K_KUBECONTEXT_CLUSTER is "gke_my-account_us-east1-a_my-cluster-01":
  #
  #   - P9K_KUBECONTEXT_CLOUD_NAME=gke
  #   - P9K_KUBECONTEXT_CLOUD_ACCOUNT=my-account
  #   - P9K_KUBECONTEXT_CLOUD_ZONE=us-east1-a
  #   - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01
  #
  # If P9K_KUBECONTEXT_CLUSTER is "arn:aws:eks:us-east-1:123456789012:cluster/my-cluster-01":
  #
  #   - P9K_KUBECONTEXT_CLOUD_NAME=eks
  #   - P9K_KUBECONTEXT_CLOUD_ACCOUNT=123456789012
  #   - P9K_KUBECONTEXT_CLOUD_ZONE=us-east-1
  #   - P9K_KUBECONTEXT_CLOUD_CLUSTER=my-cluster-01
  typeset -g POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION=
  # Show P9K_KUBECONTEXT_CLOUD_CLUSTER if it's not empty and fall back to P9K_KUBECONTEXT_NAME.
  POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${P9K_KUBECONTEXT_CLOUD_CLUSTER:-${P9K_KUBECONTEXT_NAME}}'
  # Append the current context's namespace if it's not "default".
  POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}'

  # Custom prefix.
  # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='at '

  #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
  # Show aws only when the command you are typing invokes one of these tools.
  # Tip: Remove the next line to always show aws.
  typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt'

  # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element
  # in each pair defines a pattern against which the current AWS profile gets matched.
  # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
  # that gets matched. If you unset all POWERLEVEL9K_AWS_*CONTENT_EXPANSION parameters,
  # you'll see this value in your prompt. The second element of each pair in
  # POWERLEVEL9K_AWS_CLASSES defines the profile class. Patterns are tried in order. The
  # first match wins.
  #
  # For example, given these settings:
  #
  #   typeset -g POWERLEVEL9K_AWS_CLASSES=(
  #     '*prod*'  PROD
  #     '*test*'  TEST
  #     '*'       DEFAULT)
  #
  # If your current AWS profile is "company_test", its class is TEST
  # because "company_test" doesn't match the pattern '*prod*' but does match '*test*'.
  #
  # You can define different colors, icons and content expansions for different classes:
  #
  #   typeset -g POWERLEVEL9K_AWS_TEST_FOREGROUND=28
  #   typeset -g POWERLEVEL9K_AWS_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
  #   typeset -g POWERLEVEL9K_AWS_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
  typeset -g POWERLEVEL9K_AWS_CLASSES=(
      # '*prod*'  PROD    # These values are examples that are unlikely
      # '*test*'  TEST    # to match your needs. Customize them as needed.
      '*'       DEFAULT)
  typeset -g POWERLEVEL9K_AWS_DEFAULT_FOREGROUND=7
  typeset -g POWERLEVEL9K_AWS_DEFAULT_BACKGROUND=1
  # typeset -g POWERLEVEL9K_AWS_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'

  # AWS segment format. The following parameters are available within the expansion.
  #
  # - P9K_AWS_PROFILE  The name of the current AWS profile.
  # - P9K_AWS_REGION   The region associated with the current AWS profile.
  typeset -g POWERLEVEL9K_AWS_CONTENT_EXPANSION='${P9K_AWS_PROFILE//\%/%%}${P9K_AWS_REGION:+ ${P9K_AWS_REGION//\%/%%}}'

  #[ aws_eb_env: aws elastic beanstalk environment (https://aws.amazon.com/elasticbeanstalk/) ]#
  # AWS Elastic Beanstalk environment color.
  typeset -g POWERLEVEL9K_AWS_EB_ENV_FOREGROUND=2
  typeset -g POWERLEVEL9K_AWS_EB_ENV_BACKGROUND=0
  # Custom icon.
  # typeset -g POWERLEVEL9K_AWS_EB_ENV_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##########[ azure: azure account name (https://docs.microsoft.com/en-us/cli/azure) ]##########
  # Show azure only when the command you are typing invokes one of these tools.
  # Tip: Remove the next line to always show azure.
  typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt'

  # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element
  # in each pair defines a pattern against which the current azure account name gets matched.
  # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below)
  # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters,
  # you'll see this value in your prompt. The second element of each pair in
  # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The
  # first match wins.
  #
  # For example, given these settings:
  #
  #   typeset -g POWERLEVEL9K_AZURE_CLASSES=(
  #     '*prod*'  PROD
  #     '*test*'  TEST
  #     '*'       OTHER)
  #
  # If your current azure account is "company_test", its class is TEST because "company_test"
  # doesn't match the pattern '*prod*' but does match '*test*'.
  #
  # You can define different colors, icons and content expansions for different classes:
  #
  #   typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=2
  #   typeset -g POWERLEVEL9K_AZURE_TEST_BACKGROUND=0
  #   typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
  #   typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <'
  typeset -g POWERLEVEL9K_AZURE_CLASSES=(
      # '*prod*'  PROD    # These values are examples that are unlikely
      # '*test*'  TEST    # to match your needs. Customize them as needed.
      '*'         OTHER)

  # Azure account name color.
  typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=7
  typeset -g POWERLEVEL9K_AZURE_OTHER_BACKGROUND=4
  # Custom icon.
  # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]###########
  # Show gcloud only when the command you are typing invokes one of these tools.
  # Tip: Remove the next line to always show gcloud.
  typeset -g POWERLEVEL9K_GCLOUD_SHOW_ON_COMMAND='gcloud|gcs|gsutil'
  # Google cloud color.
  typeset -g POWERLEVEL9K_GCLOUD_FOREGROUND=7
  typeset -g POWERLEVEL9K_GCLOUD_BACKGROUND=4

  # Google cloud format. Change the value of POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION and/or
  # POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION if the default is too verbose or not informative
  # enough. You can use the following parameters in the expansions. Each of them corresponds to the
  # output of `gcloud` tool.
  #
  #   Parameter                | Source
  #   -------------------------|--------------------------------------------------------------------
  #   P9K_GCLOUD_CONFIGURATION | gcloud config configurations list --format='value(name)'
  #   P9K_GCLOUD_ACCOUNT       | gcloud config get-value account
  #   P9K_GCLOUD_PROJECT_ID    | gcloud config get-value project
  #   P9K_GCLOUD_PROJECT_NAME  | gcloud projects describe $P9K_GCLOUD_PROJECT_ID --format='value(name)'
  #
  # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced with '%%'.
  #
  # Obtaining project name requires sending a request to Google servers. This can take a long time
  # and even fail. When project name is unknown, P9K_GCLOUD_PROJECT_NAME is not set and gcloud
  # prompt segment is in state PARTIAL. When project name gets known, P9K_GCLOUD_PROJECT_NAME gets
  # set and gcloud prompt segment transitions to state COMPLETE.
  #
  # You can customize the format, icon and colors of gcloud segment separately for states PARTIAL
  # and COMPLETE. You can also hide gcloud in state PARTIAL by setting
  # POWERLEVEL9K_GCLOUD_PARTIAL_VISUAL_IDENTIFIER_EXPANSION and
  # POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION to empty.
  typeset -g POWERLEVEL9K_GCLOUD_PARTIAL_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_ID//\%/%%}'
  typeset -g POWERLEVEL9K_GCLOUD_COMPLETE_CONTENT_EXPANSION='${P9K_GCLOUD_PROJECT_NAME//\%/%%}'

  # Send a request to Google (by means of `gcloud projects describe ...`) to obtain project name
  # this often. Negative value disables periodic polling. In this mode project name is retrieved
  # only when the current configuration, account or project id changes.
  typeset -g POWERLEVEL9K_GCLOUD_REFRESH_PROJECT_NAME_SECONDS=60

  # Custom icon.
  # typeset -g POWERLEVEL9K_GCLOUD_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #[ google_app_cred: google application credentials (https://cloud.google.com/docs/authentication/production) ]#
  # Show google_app_cred only when the command you are typing invokes one of these tools.
  # Tip: Remove the next line to always show google_app_cred.
  typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_SHOW_ON_COMMAND='terraform|pulumi|terragrunt'

  # Google application credentials classes for the purpose of using different colors, icons and
  # expansions with different credentials.
  #
  # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES is an array with even number of elements. The first
  # element in each pair defines a pattern against which the current kubernetes context gets
  # matched. More specifically, it's P9K_CONTENT prior to the application of context expansion
  # (see below) that gets matched. If you unset all POWERLEVEL9K_GOOGLE_APP_CRED_*CONTENT_EXPANSION
  # parameters, you'll see this value in your prompt. The second element of each pair in
  # POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES defines the context class. Patterns are tried in order.
  # The first match wins.
  #
  # For example, given these settings:
  #
  #   typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=(
  #     '*:*prod*:*'  PROD
  #     '*:*test*:*'  TEST
  #     '*'           DEFAULT)
  #
  # If your current Google application credentials is "service_account deathray-testing x@y.com",
  # its class is TEST because it doesn't match the pattern '* *prod* *' but does match '* *test* *'.
  #
  # You can define different colors, icons and content expansions for different classes:
  #
  #   typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_FOREGROUND=28
  #   typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐'
  #   typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_TEST_CONTENT_EXPANSION='$P9K_GOOGLE_APP_CRED_PROJECT_ID'
  typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES=(
      # '*:*prod*:*'  PROD    # These values are examples that are unlikely
      # '*:*test*:*'  TEST    # to match your needs. Customize them as needed.
      '*'             DEFAULT)
  typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_FOREGROUND=7
  typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_BACKGROUND=4
  # typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_VISUAL_IDENTIFIER_EXPANSION='⭐'

  # Use POWERLEVEL9K_GOOGLE_APP_CRED_CONTENT_EXPANSION to specify the content displayed by
  # google_app_cred segment. Parameter expansions are very flexible and fast, too. See reference:
  # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion.
  #
  # You can use the following parameters in the expansion. Each of them corresponds to one of the
  # fields in the JSON file pointed to by GOOGLE_APPLICATION_CREDENTIALS.
  #
  #   Parameter                        | JSON key file field
  #   ---------------------------------+---------------
  #   P9K_GOOGLE_APP_CRED_TYPE         | type
  #   P9K_GOOGLE_APP_CRED_PROJECT_ID   | project_id
  #   P9K_GOOGLE_APP_CRED_CLIENT_EMAIL | client_email
  #
  # Note: ${VARIABLE//\%/%%} expands to ${VARIABLE} with all occurrences of '%' replaced by '%%'.
  typeset -g POWERLEVEL9K_GOOGLE_APP_CRED_DEFAULT_CONTENT_EXPANSION='${P9K_GOOGLE_APP_CRED_PROJECT_ID//\%/%%}'

  ##############[ toolbox: toolbox name (https://github.com/containers/toolbox) ]###############
  # Toolbox color.
  typeset -g POWERLEVEL9K_TOOLBOX_FOREGROUND=0
  typeset -g POWERLEVEL9K_TOOLBOX_BACKGROUND=3
  # Don't display the name of the toolbox if it matches fedora-toolbox-*.
  typeset -g POWERLEVEL9K_TOOLBOX_CONTENT_EXPANSION='${P9K_TOOLBOX_NAME:#fedora-toolbox-*}'
  # Custom icon.
  # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # Custom prefix.
  # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='in '

  ###############################[ public_ip: public IP address ]###############################
  # Public IP color.
  typeset -g POWERLEVEL9K_PUBLIC_IP_FOREGROUND=7
  typeset -g POWERLEVEL9K_PUBLIC_IP_BACKGROUND=0
  # Custom icon.
  # typeset -g POWERLEVEL9K_PUBLIC_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ########################[ vpn_ip: virtual private network indicator ]#########################
  # VPN IP color.
  typeset -g POWERLEVEL9K_VPN_IP_FOREGROUND=0
  typeset -g POWERLEVEL9K_VPN_IP_BACKGROUND=6
  # When on VPN, show just an icon without the IP address.
  # Tip: To display the private IP address when on VPN, remove the next line.
  typeset -g POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION=
  # Regular expression for the VPN network interface. Run `ifconfig` or `ip -4 a show` while on VPN
  # to see the name of the interface.
  typeset -g POWERLEVEL9K_VPN_IP_INTERFACE='(gpd|wg|(.*tun)|tailscale)[0-9]*|(zt.*)'
  # If set to true, show one segment per matching network interface. If set to false, show only
  # one segment corresponding to the first matching network interface.
  # Tip: If you set it to true, you'll probably want to unset POWERLEVEL9K_VPN_IP_CONTENT_EXPANSION.
  typeset -g POWERLEVEL9K_VPN_IP_SHOW_ALL=false
  # Custom icon.
  # typeset -g POWERLEVEL9K_VPN_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ###########[ ip: ip address and bandwidth usage for a specified network interface ]###########
  # IP color.
  typeset -g POWERLEVEL9K_IP_BACKGROUND=4
  typeset -g POWERLEVEL9K_IP_FOREGROUND=0
  # The following parameters are accessible within the expansion:
  #
  #   Parameter             | Meaning
  #   ----------------------+-------------------------------------------
  #   P9K_IP_IP             | IP address
  #   P9K_IP_INTERFACE      | network interface
  #   P9K_IP_RX_BYTES       | total number of bytes received
  #   P9K_IP_TX_BYTES       | total number of bytes sent
  #   P9K_IP_RX_BYTES_DELTA | number of bytes received since last prompt
  #   P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt
  #   P9K_IP_RX_RATE        | receive rate (since last prompt)
  #   P9K_IP_TX_RATE        | send rate (since last prompt)
  typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+⇡$P9K_IP_TX_RATE }$P9K_IP_IP'
  # Show information for the first network interface whose name matches this regular expression.
  # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces.
  typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*'
  # Custom icon.
  # typeset -g POWERLEVEL9K_IP_VISUAL_IDENTIFIER_EXPANSION='⭐'

  #########################[ proxy: system-wide http/https/ftp proxy ]##########################
  # Proxy color.
  typeset -g POWERLEVEL9K_PROXY_FOREGROUND=4
  typeset -g POWERLEVEL9K_PROXY_BACKGROUND=0
  # Custom icon.
  # typeset -g POWERLEVEL9K_PROXY_VISUAL_IDENTIFIER_EXPANSION='⭐'

  ################################[ battery: internal battery ]#################################
  # Show battery in red when it's below this level and not connected to power supply.
  typeset -g POWERLEVEL9K_BATTERY_LOW_THRESHOLD=20
  typeset -g POWERLEVEL9K_BATTERY_LOW_FOREGROUND=1
  # Show battery in green when it's charging or fully charged.
  typeset -g POWERLEVEL9K_BATTERY_{CHARGING,CHARGED}_FOREGROUND=2
  # Show battery in yellow when it's discharging.
  typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=3
  # Battery pictograms going from low to high level of charge.
  typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578'
  # Don't show the remaining time to charge/discharge.
  typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false
  typeset -g POWERLEVEL9K_BATTERY_BACKGROUND=0

  #####################################[ wifi: wifi speed ]#####################################
  # WiFi color.
  typeset -g POWERLEVEL9K_WIFI_FOREGROUND=0
  typeset -g POWERLEVEL9K_WIFI_BACKGROUND=4
  # Custom icon.
  # typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='⭐'

  # Use different colors and icons depending on signal strength ($P9K_WIFI_BARS).
  #
  #   # Wifi colors and icons for different signal strength levels (low to high).
  #   typeset -g my_wifi_fg=(0 0 0 0 0)                                # <-- change these values
  #   typeset -g my_wifi_icon=('WiFi' 'WiFi' 'WiFi' 'WiFi' 'WiFi')     # <-- change these values
  #
  #   typeset -g POWERLEVEL9K_WIFI_CONTENT_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}$P9K_WIFI_LAST_TX_RATE Mbps'
  #   typeset -g POWERLEVEL9K_WIFI_VISUAL_IDENTIFIER_EXPANSION='%F{${my_wifi_fg[P9K_WIFI_BARS+1]}}${my_wifi_icon[P9K_WIFI_BARS+1]}'
  #
  # The following parameters are accessible within the expansions:
  #
  #   Parameter             | Meaning
  #   ----------------------+---------------
  #   P9K_WIFI_SSID         | service set identifier, a.k.a. network name
  #   P9K_WIFI_LINK_AUTH    | authentication protocol such as "wpa2-psk" or "none"; empty if unknown
  #   P9K_WIFI_LAST_TX_RATE | wireless transmit rate in megabits per second
  #   P9K_WIFI_RSSI         | signal strength in dBm, from -120 to 0
  #   P9K_WIFI_NOISE        | noise in dBm, from -120 to 0
  #   P9K_WIFI_BARS         | signal strength in bars, from 0 to 4 (derived from P9K_WIFI_RSSI and P9K_WIFI_NOISE)

  ####################################[ time: current time ]####################################
  # Current time color.
  typeset -g POWERLEVEL9K_TIME_FOREGROUND=0
  typeset -g POWERLEVEL9K_TIME_BACKGROUND=7
  # Format for the current time: 09:51:02. See `man 3 strftime`.
  typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
  # If set to true, time will update when you hit enter. This way prompts for the past
  # commands will contain the start times of their commands as opposed to the default
  # behavior where they contain the end times of their preceding commands.
  typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
  # Custom icon.
  # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐'
  # Custom prefix.
  # typeset -g POWERLEVEL9K_TIME_PREFIX='at '

  # Example of a user-defined prompt segment. Function prompt_example will be called on every
  # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or
  # POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS. It displays an icon and yellow text on red background
  # greeting the user.
  #
  # Type `p10k help segment` for documentation and a more sophisticated example.
  function prompt_example() {
    p10k segment -b 1 -f 3 -i '⭐' -t 'hello, %n'
  }

  # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job
  # is to generate the prompt segment for display in instant prompt. See
  # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
  #
  # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function
  # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k
  # will replay these calls without actually calling instant_prompt_*. It is imperative that
  # instant_prompt_* always makes the same `p10k segment` calls regardless of environment. If this
  # rule is not observed, the content of instant prompt will be incorrect.
  #
  # Usually, you should either not define instant_prompt_* or simply call prompt_* from it. If
  # instant_prompt_* is not defined for a segment, the segment won't be shown in instant prompt.
  function instant_prompt_example() {
    # Since prompt_example always makes the same `p10k segment` calls, we can call it from
    # instant_prompt_example. This will give us the same `example` prompt segment in the instant
    # and regular prompts.
    prompt_example
  }

  # User-defined prompt segments can be customized the same way as built-in segments.
  typeset -g POWERLEVEL9K_EXAMPLE_FOREGROUND=3
  typeset -g POWERLEVEL9K_EXAMPLE_BACKGROUND=1
  # typeset -g POWERLEVEL9K_EXAMPLE_VISUAL_IDENTIFIER_EXPANSION='⭐'

  # Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt
  # when accepting a command line. Supported values:
  #
  #   - off:      Don't change prompt when accepting a command line.
  #   - always:   Trim down prompt when accepting a command line.
  #   - same-dir: Trim down prompt when accepting a command line unless this is the first command
  #               typed after changing current working directory.
  typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off

  # Instant prompt mode.
  #
  #   - off:     Disable instant prompt. Choose this if you've tried instant prompt and found
  #              it incompatible with your zsh configuration files.
  #   - quiet:   Enable instant prompt and don't print warnings when detecting console output
  #              during zsh initialization. Choose this if you've read and understood
  #              https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt.
  #   - verbose: Enable instant prompt and print a warning when detecting console output during
  #              zsh initialization. Choose this if you've never tried instant prompt, haven't
  #              seen the warning, or if you are unsure what this all means.
  typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose

  # Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
  # For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload
  # can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you
  # really need it.
  typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true

  # If p10k is already loaded, reload configuration.
  # This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
  (( ! $+functions[p10k] )) || p10k reload
}

# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}

(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts'

A.9 壁纸自启与会话文件

.fehbg(2 行)

bash 复制代码
#!/bin/sh
feh --no-fehbg --bg-fill '/home/sirius/图片/壁纸/浏览器/20230827170427.jpg' 

A.9b

.dmrc(2 行)

ini 复制代码
[Desktop]
Session=xfce
相关推荐
qeen871 小时前
【Linux】动静态库的链接与加载过程
linux·运维·系统编程
重生之小比特2 小时前
【Linux系统】17 库制作与原理(上)
linux·运维·服务器
wzg20162 小时前
ubuntu 离线安装 docker-compose
linux·ubuntu·docker
行走的陀螺仪2 小时前
Claude Code 从入门到实战(三):Hooks、Skills、SubAgents 高级扩展
linux·编辑器·vim
Brilliantwxx3 小时前
【STM32】 内部 Flash 的 HAL 库函数详解与自定义封装实战
linux·服务器·网络
码途行者3 小时前
Linux 服务器 Golang 安装及环境变量配置
linux·运维·服务器
叼烟扛炮3 小时前
Linux 学习笔记(四十七):TCP 状态机与 tcpdump 抓包排雷实战
linux·网络·笔记·学习·tcp/ip·tcpdump
爱和冰阔落4 小时前
【Linux网络】UDP 聊天室怎么实现?从在线用户管理、消息广播到双线程收发与线程池
linux·运维·网络·udp
雪落漂泊4 小时前
Linux进程(三)概念:进程优先级与进程切换篇
linux·运维·服务器