Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Latest commit

 

History

History
20 lines (13 loc) · 771 Bytes

状态栏命令.md

File metadata and controls

20 lines (13 loc) · 771 Bytes

状态栏命令

i3bar 可以运行一个程序,把它的 stdout 的每一行显示在工作区栏的右边。这对显示系统信息很有用,比如你当前的 IP 地址、电池状态或日期/时间。

这个特定的命令会被传到 sh -c 执行,因此你可以使用 globbing,且必须使用正确的引号等。注意,对于信号处理,取决你的 shell(已知 dash(1) 的用户会受到影响),你必须使用 shell 的 exec 命令。这样信号就会传递给你的程序而不是 shell。

语法:

status_command <command>

例子:

bar {
    status_command i3status --config ~/.i3status.conf

    # 想要信号处理正常工作的 dash(1) 用户:
    status_command exec ~/.bin/my_status_command
}