Arch linux i3bar之i3status配置

Arch linux 安装I3WM相关信息请参考https://wiki.archlinux.org/index.php/i3

安装完i3wm后,当你进入系统时,或许桌面如下:

注意到上图桌面底部的状态栏了吗?笔者用的是i3bar+i3status的效果。这些信息是通过i3配置文件里的bar字段来配置及i3status config配置文件来控制的。请细配置信息请参考:https://wiki.archlinux.org/index.php/i3#i3bar https://i3wm.org/docs/userguide.html#_configuring_i3bar

笔者也没太多的要求,就按它默认的来就行了。不过还是想在状态栏的日期后面显示星期几。修改i3status config配置文件。

检查确认是否已安装 i3status: $ sudo pacman -Ss i3status 如没安装 $ sudo pacman -S i3status 复制配置文件至当然home目录 下:

$ cp /etc/i3status.conf ~/.config/i3status/config

如果 /etc/目录 下没有i3status.conf文件,那只能自己创建这个文件了,笔者安装好后发现/etc/目录 下是没有这个配置文件的,所以 只能从网上搜索了然后创建config文件。配置文件内容如下:

# i3status configuration file.
# see "man i3status" for documentation.

# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!

general {
        colors = true
        interval = 5
}

order += "ipv6"
order += "wireless _first_"
order += "ethernet _first_"
order += "battery all"
order += "disk /"
order += "load"
order += "memory"
order += "tztime local"

wireless _first_ {
        format_up = "W: (%quality at %essid) %ip"
        format_down = "W: down"
}

ethernet _first_ {
        format_up = "E: %ip (%speed)"
        format_down = "E: down"
}

battery all {
        format = "%status %percentage %remaining"
}

disk "/" {
        format = "%avail"
}

load {
        format = "%1min"
}

memory {
        format = "%used | %available"
        threshold_degraded = "1G"
        format_degraded = "MEMORY < %available"
}

tztime local {
        format = "%Y-%m-%d %H:%M:%S %A"
}

注意到上面配置文件字段tztime local,format = “%Y-%m-%d %H:%M:%S %A” 最后添加一个%A 就可以显示星期几了。