xmobar - 如何格式化字符串输出
问题描述
如何使 cpu 百分比指标具有固定宽度或在低于 100 时插入 0。
我的cpu配置
commands = [
Run Cpu [
"--template", "cpu: <total>%",
"-L", "3",
"-H", "50",
"--normal", "green",
"--high", "red"] 10
]
解决方案
You can use option -m
to set minimum width
commands = [
Run Cpu [
"--template", "cpu: <total>%",
"-L", "3",
"-H", "50",
"-m", "3",
"--normal", "green",
"--high", "red"] 10
]
推荐阅读
- blockchain - bigchaindb 的用例 - bigchaindb 如何去中心化?
- java - 尝试在 Raspberry Pi 上运行 Arduino IDE 时出错
- sql - 查询获取期间的总采购和期末库存
- scala - 如何使用 AWS 签名版本 4 发送加特林请求?
- c++ - c++ 数组setter和getter
- excel - 将具有特定名称的 Excel 工作表从多个工作簿复制到新工作簿
- robotics - 您如何根据 DH 参数计算末端执行器的笛卡尔位置?
- linux - 基于唯一列合并两个列表文件
- haskell - 这个折叠树函数在 Haskell 中是如何工作的
- ruby-on-rails - 栈桥 HTTP Origin 标头 (https:..) 。不匹配 request.base_url (http:// )