conky - 厳密な幅制限を設定する方法

conky - 厳密な幅制限を設定する方法

画面上部を横切る垂直コンキーバーを水平コンキーバーに変更しています。

の場合、Name and CPU %最大幅の列を設定する方法は?Name CPU%次の列をオフセットにするように固定幅を設定する必要があります。ターミナルの端まで自動的に拡張されます。

ここに画像の説明を入力してください。

conky.text = [[
${alignc} Darin's Computer <<<Gentoo>>> on $machine
$stippled_hr
${alignc}${color}Uptime:${color} $uptime ${color}
${voffset 10}${color }${color}CPU Temperature: ${color white}${exec sensors | grep Tctl | cut -c16-17} c
${color yellow}${cpugraph cpu0 40,500ffff00 ffffff}
${voffset -67} ${offset 545}${color }RAM Usage:${color white} $memperc
${offset 550}${color}${color yellow}${membar 8,500 /}
${offset 550}${color}File Systems:${color white} ${fs_used_perc /}
${offset 550}${color yellow}${fs_bar 8,500 /}

$color$stippled_hr

${voffset -105}${offset 1130}${color}Name       ${alignr}CPU o/o #HERE IS WHERE I NEED TO SET A HARD WIDTH
${offset 1130}${color white} ${top name 1} ${alignr}${top cpu 1}
${offset 1130}${color yellow} ${top name 2} ${alignr}${top cpu 2}
${offset 1130}${color yellow} ${top name 3} ${alignr}${top cpu 3}
${offset 1130}${color yellow} ${top name 4} ${alignr}${top cpu 4}

${color}$stippled_hr

${offset 1300}${color}Networking:
 Down:${color white} ${downspeed enp2s0} k/s${color white}
${color yellow}${downspeedgraph enp2s0 10,150 ffffff}
${color}${offset 5}Up:${color white} ${upspeed enp2s0} k/s
${color yellow}${upspeedgraph enp2s0 10,150 ffffff}

${color}Port(s) and Connections 
$color Inbound: ${color white}${tcp_portmon 1 32767 count} ${color} Outbound: ${color white}${tcp_portmon 32768 61000 count}  ${color}ALL: ${color white}${tcp_portmon 1 65535 count}
${color}Inbound Con. ${alignr} Port${color white}
 ${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}

ベストアンサー1

tab1 つの方法は、オブジェクトを使用して右側のヘッダーを配置し、オフセットを使用して右側の列オブジェクトをtop配置することです。

${offset 15}${color orange}Name${tab 160 15}CPU o/o
${offset 15}${color white}${top name 1}${offset 25}${top cpu 1}
${offset 15}${color yellow}${top name 2}${offset 25}${top cpu 2}
${offset 15}${color yellow}${top name 3}${offset 25}${top cpu 3}
${offset 15}${color yellow}${top name 4}${offset 25}${top cpu 4}

conky の上のオブジェクトの固定幅列図

おすすめ記事