我想在我的 i3 状态栏中运行 conky。使用 conkyi3.sh 脚本作为 status_command 效果很好:
#!/bin/sh
echo "{\"version\":1}"
echo "[[]"
exec conky -c $HOME/.conkyrc
这是我的 conky:
out_to_x no
out_to_console yes
own_window no
short_units yes
update_interval 1
background no
total_run_times 0
short_units yes
use_spacer left
override_utf8_locale no
cpu_avg_samples 2
TEXT
,[
# Kernel:
{"full_text":"","color":"\#0048ff","separator":false,"separator_block_width":6},\
{"full_text":"${kernel}","color":"\#f9f9f9","separator":false,"separator_block_width":6},\
# ip (every 10 minutes)
{"full_text":"","color":"\#0048ff","separator":false,"separator_block_width":6},\
{"full_text":"${exec wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]|.]//g'} ","color":"\#f9f9f9","separator":false,"separator_block_width":0},\
#Finds current volume. May need modified depending on your setup"
{"full_text":"${if_match "${exec pactl list sinks | grep "Mute:" | cut -d " " -f2}"=="yes"}","color":"\#0048ff","separator":false,"separator_block_width":6},\
{"full_text":"- ","color":"\#f9f9f9","separator":false,"separator_block_width":0},\
{"full_text":"${else}"},\
{"full_text":"${if_match "${exec pactl list sinks | grep "Mute:" | cut -d " " -f2}"=="no"}","color":"\#0048ff","separator":false,"separator_block_width":6},\
{"full_text":"${exec amixer get Master |grep % |awk '{print $5}'|sed 's/[^0-9\%]//g' | head -n 1} ","color":"\#f9f9f9","separator":false,"separator_block_width":0},\
{"full_text":"${endif}${endif}"},\
# Date:
{"full_text":"","color":"\#0048ff","separator":false,"separator_block_width":6},\
{"full_text":"${time %m/%d/%Y}","color":"\#f9f9f9","separator":false,"separator_block_width":6},\
# Time:
{"full_text":"","color":"\#0048ff","separator":false,"separator_block_width":6},\
{"full_text":"${time %r}","color":"\#f9f9f9","separator":false},\
#check for updates
{"full_text":"${if_match ${exec checkupdates | wc -l}>0} ${exec checkupdates | wc -l}","color":"\#66ff66","separator":false,"separator_block_width":6},\
{"full_text":"${endif}"}\
]
这真是太棒了,不是吗?
是的,但我的问题在于我无法看到每秒的时间更新,因为 IP 爬虫和更新检查器耗时太长。我该如何解决我的问题?也许将它们分成其他配置?但如何加载它们呢?
请帮帮我!我想看实时信息,又不想失去我的功能。
答案1
拆分成几个 conky 进程可能会解决问题。你可以像这样运行多个 conky 会话:
启动第一个进程:
conky -c /path/to/config
然后是第二个会话,如下所示:
conky -c /path/to/other/conky/config