没有“lua”的“conky”:条形图可以恢复吗?

没有“lua”的“conky”:条形图可以恢复吗?

lua你绝对

没有的话又怎样lua?能conky不是像这样从左到右绘制 10% 的条形:
█░░░░░░░░░
而是像这样从右到左绘制?:
░░░░░░░░░█

例如Rainmeter为了Windows是否恢复Flip=1

具体来说,我更喜欢fs_freefs_used并且希望fs_bar能够连贯,显示用过的左侧暗淡并突出显示自由的在右手侧。

答案1

不是一个正确的翻转,但你可以尝试“模仿”它

截屏

# cat ~/.conkyrc
total_run_times 0
alignment top_middle
border_width 0
border_inner_margin 0
border_outer_margin 0
default_color white
own_window_colour black
draw_borders no
draw_outline no
draw_shades no
use_xft yes
minimum_size  500 50
maximum_width 500
extra_newline no
double_buffer yes
own_window yes
own_window_class Conky
own_window_type desktop
default_bar_size 0 51
default_graph_size 0 24
update_interval 1.0

TEXT
${color green}other content
${color  blue}${voffset   0}${execibar 3600 echo 61.8%}
${color  blue}${voffset -52}${alignc}${offset -1}${font DejaVu Sans:size=12}vanilla conky bar given 61.8%
${color  blue}${voffset -24}${alignc}${offset  0}${font DejaVu Sans:size=12}vanilla conky bar given 61.8%
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}vanilla conky bar given 61.8%
${color  blue}${voffset -23}${alignc}${offset -1}${font DejaVu Sans:size=12}vanilla conky bar given 61.8%
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}vanilla conky bar given 61.8%
${color  blue}${voffset -23}${alignc}${offset -1}${font DejaVu Sans:size=12}vanilla conky bar given 61.8%
${color  blue}${voffset -24}${alignc}${offset  0}${font DejaVu Sans:size=12}vanilla conky bar given 61.8%
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}vanilla conky bar given 61.8%
${color green}${voffset -25}${alignc}${offset  0}${font DejaVu Sans:size=12}vanilla conky bar given 61.8%
${color green}${voffset  15}other content
${color green}${voffset  12}${hr 50}
${color  blue}${voffset -44}${execibar 3600 echo 61.8%}
${color  blue}${voffset -52}${alignc}${offset -1}${font DejaVu Sans:size=12}custom color for 38.2% on the right
${color  blue}${voffset -24}${alignc}${offset  0}${font DejaVu Sans:size=12}custom color for 38.2% on the right
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}custom color for 38.2% on the right
${color  blue}${voffset -23}${alignc}${offset -1}${font DejaVu Sans:size=12}custom color for 38.2% on the right
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}custom color for 38.2% on the right
${color  blue}${voffset -23}${alignc}${offset -1}${font DejaVu Sans:size=12}custom color for 38.2% on the right
${color  blue}${voffset -24}${alignc}${offset  0}${font DejaVu Sans:size=12}custom color for 38.2% on the right
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}custom color for 38.2% on the right
${color green}${voffset -25}${alignc}${offset  0}${font DejaVu Sans:size=12}custom color for 38.2% on the right
${color green}${voffset  15}other content
${color green}${voffset  12}${hr 50}
${color  blue}${voffset -44}${execibar 3600 echo 61.8%}
${color black}${voffset -81}${hr 1}
${color black}${voffset  27}${hr 1}
${color  blue}${voffset -48}${alignc}${offset -1}${font DejaVu Sans:size=12}no bar border
${color  blue}${voffset -24}${alignc}${offset  0}${font DejaVu Sans:size=12}no bar border
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}no bar border
${color  blue}${voffset -23}${alignc}${offset -1}${font DejaVu Sans:size=12}no bar border
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}no bar border
${color  blue}${voffset -23}${alignc}${offset -1}${font DejaVu Sans:size=12}no bar border
${color  blue}${voffset -24}${alignc}${offset  0}${font DejaVu Sans:size=12}no bar border
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}no bar border
${color green}${voffset -25}${alignc}${offset  0}${font DejaVu Sans:size=12}no bar border
${color green}${voffset  15}other content
${color green}${voffset  12}${hr 50}
${color black}${voffset -44}${execibar 3600 echo 61.8%}
${color green}${voffset -81}${hr 1}
${color green}${voffset  27}${hr 1}
${color  blue}${voffset -48}${alignc}${offset -1}${font DejaVu Sans:size=12}conky-style bar right-to-left
${color  blue}${voffset -24}${alignc}${offset  0}${font DejaVu Sans:size=12}conky-style bar right-to-left
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}conky-style bar right-to-left
${color  blue}${voffset -23}${alignc}${offset -1}${font DejaVu Sans:size=12}conky-style bar right-to-left
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}conky-style bar right-to-left
${color  blue}${voffset -23}${alignc}${offset -1}${font DejaVu Sans:size=12}conky-style bar right-to-left
${color  blue}${voffset -24}${alignc}${offset  0}${font DejaVu Sans:size=12}conky-style bar right-to-left
${color  blue}${voffset -24}${alignc}${offset  1}${font DejaVu Sans:size=12}conky-style bar right-to-left
${color green}${voffset -25}${alignc}${offset  0}${font DejaVu Sans:size=12}conky-style bar right-to-left
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content
${color green}${voffset  15}other content

在这里,我们在 z 轴上的${hr 50}条形下方放置了一个矩形。 我们将它们放在 的位置。 向上移动的事物将覆盖那里的一切。default_bar_size 0 51 ${execibar 3600 echo 61.8%}
${voffset -...}

这种方法使右侧看起来突出显示,但实际上并没有翻转栏。对于内置的fs_barfs_bar_free这工作得很好。对于其他人则battery_bar不然。
因为当你通过和朋友获得你的值时execbar,你需要从 100 中减去百分比,如下所示:

$(( 100 - 62 ))  # integers, not floats

echo '100 - 61.8' | bc
bc -e "100 - $(echo 61.8)" -e quit

echo 61.8 | awk '{print 100 - $1}'
awk 'BEGIN { while ("echo 61.8" | getline var) print 100 - var }'

echo 61.8 | perl -nE 'say 100 - $_'
perl -E 'say 100 - `echo 61.8`'

单杠边框可以是:

  • 保留(第二栏)
  • 蒙面(第三小节)
  • 看起来从右到左(第四小节)

${hr 1}第三条和第四条中的边框通过和进行操作${voffset -...}

为了使文本在两种颜色上都清晰可见,我们通过放置额外的 8 个相同的文本字符串来勾勒出它的轮廓,将它们在 4 个直线方向和 4 个对角线方向上各放置 1 个像素。

xcolor(1)实用程序(内部显示“ent”的圆圈)可用作放大细节的辅助工具。

酒吧的右边有不想要的剩菜,我不知道如何处理掉。请分享。

当您 时${voffset -...},conky 窗口不会垂直缩小,并且您留下的窗口过长。只需将其放在屏幕底部或用另一个conky窗口或面板或其他东西覆盖即可。如果有正确的解决方案请分享。

相关内容