定位 Conky 并删除 Conky 的黑色背景

定位 Conky 并删除 Conky 的黑色背景

我真的很喜欢 Conky应该将它添加到我的桌面,但它似乎无法正常工作。Conky 的窗口不是透明的,而是黑色的。它还位于 top_left 位置。我希望它位于屏幕的 middle_middle 位置。

# Conky settings #
background yes
update_interval 1
double_buffer yes
no_buffers yes

# Window specifications #
gap_x 0
gap_y 0
minimum_size 600 0
maximum_width 711
own_window yes
own_window_type dock
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
#own_window_argb_visual yes
#own_window_argb_value 0
#border_margin 0
#border_inner_margin 0
#border_outer_margin 0
#alignment middle_middle

# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# Text settings #
use_xft yes
xftalpha 0
xftfont Open Sans Light:size=10

override_utf8_locale yes

imlib_cache_size 0

# Color scheme #
default_color FFFFFF

color1 FFFFFF
color2 FFFFFF
color3 FFFFFF
color4 FFFFFF
color5 FFFFFF
color6 FFFFFF
color7 333333

TEXT
${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=733881&u=c" -o ~/.cache/weather.xml}


${font Raleway:weight=Light :size=100}${voffset -40}${alignc}${time %H}${alignc}:${alignc}${time %M}
${font Raleway:weight=Light:size=32}${voffset -40}${alignc}${time %A %B %d}


${font Raleway:size=20}
${voffset -64}${alignc 216}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°
${font Raleway:weight=Light:size=14}
${voffset -52}${alignc 122}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°
${voffset -19}${alignc 12}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°
${voffset -19}${alignc -98}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°
${voffset -19}${alignc -208}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°


${font Raleway:weight=Light:size=10}
${voffset -10}${alignc 98}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°
${voffset -14}${alignc -12}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°
${voffset -14}${alignc -122}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°
${voffset -14}${alignc -232}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°


${font Raleway:weight=Light:size=14}
${voffset -26}${alignc 220}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}
${voffset -18}${alignc 110}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}
${voffset -19}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}
${voffset -18}${alignc -110}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4' | tr '[a-z]' '[A-Z]'}
${voffset -19}${alignc -220}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5' | tr '[a-z]' '[A-Z]'}


${font Raleway:weight=Light:size=14}
${execi 300 cp -f ~/.conky-weather-icons/$(grep "yweather:condition" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 61,320 -s 32x32}${execi 300 cp -f ~/.conky-weather-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 171,320 -s 32x32}${execi 300 cp -f ~/.conky-weather-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 281,320 -s 32x32}${execi 300 cp -f ~/.conky-weather-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png ~/.cache/weather-4.png}${image ~/.cache/weather-4.png -p 391,320 -s 32x32}${execi 300 cp -f ~/.conky-weather-icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png ~/.cache/weather-5.png}${image ~/.cache/weather-5.png -p 501,320 -s 32x32}${font}

答案1

问题:Conky 的窗口不透明,而是黑色的。
解决方案: own_window_argb_value 0 # 设置 conky 背景不透明度 (0 透明,63-127-191 25-50-75% 半透明,255 不透明)
前提条件: own_window_argb_visual yes # 启用 ARGB 设置


问题:它也位于 top_left 位置。我希望它位于屏幕的 middle_middle 位置。
解决方案:alignment middle_middle # 显示在屏幕中间,水平和垂直居中

这应该可以解决您的问题。祝您玩得开心!

答案2

您可以尝试 Conky Color,它的设置非常简单。

http://gnome-look.org/content/show.php/CONKY-colors?content=92328

答案3

不要设置own_window_typedock,而要设置为override。这样您就可以将对齐方式设置为middle_middle,或者其他任何位置。此外,您的配置已被alignment middle_middle注释掉,您需要取消注释。此外,删除(或保留注释)own_window_argb_visualown_window_argb_value行,因为这些行会使您的背景变黑。

答案4

这是整个透明的、右上方的工作状态,因此您可以看到位置正确的线条(您可能会喜欢一些额外的内容 - ESSID、链接和比特率仅适用于 Linux - 在 Windows 中会遗漏这些线条。另外,用您的无线适配器的名称替换我放置的位置 - wlp13s0):

conky.config = {
    alignment = 'top_right',
    background = false,
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'DejaVu Sans Mono:size=10',
    gap_x = 60,
    gap_y = 60,
    minimum_height = 5,
    minimum_width = 5,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_class = 'Conky',
    own_window_type = 'desktop',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 1.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,
    own_window_argb_visual = true,
    own_window_argb_value = 50,
    double_buffer = true,
    update_interval = 2.0,
}

conky.text = [[
${color grey}Info:$color ${scroll 32 Conky $conky_version}
${color grey}System:$color $sysname
${color}$nodename
${color grey}Kernel:$color $kernel
${color grey}Machine:$color $machine
$hr
${color grey}Uptime:$color $uptime
${color grey}Frequency (in MHz):$color $freq
${color grey}Frequency (in GHz):$color $freq_g
${color grey}RAM Usage:$color $mem/$memmax - $memperc% ${membar 4}
${color grey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar 4}
${color grey}CPU Usage:$color $cpu% ${cpubar 4}
${color grey}CPU temperature:$color ${hwmon 4 temp 1}°C
${color grey}Processes:$color $processes  ${color grey}Running:$color $running_processes
$hr
${color grey}File systems:
 / $color${fs_used /}/${fs_size /} ${fs_bar 6 /}
${color grey}Wireless networking:
Up:$color ${upspeed wlp13s0} ${color grey} - Down:$color ${downspeed wlp13s0}
${color grey}ESSID:${color} ${wireless_essid wlp13s0}
${color grey}Bitrate:${color} ${wireless_bitrate wlp13s0}
${color grey}Link quality:${color} ${wireless_link_qual_perc wlp13s0}%
$hr
${color grey}Name              PID     CPU%   MEM%
${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${color lightgrey} ${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}
${color lightgrey} ${top name 6} ${top pid 6} ${top cpu 6} ${top mem 6}
]]

相关内容