Conky 在 Ubuntu 16.04 GNOME 上无法正常工作

Conky 在 Ubuntu 16.04 GNOME 上无法正常工作

我在使用 conky 时遇到了一个奇怪的问题。它无法在桌面上正确显示:

它没有在桌面上正确显示。

我尝试了所有方法,从编辑 conky 小部件文件到重新安装 conky 和 ​​conky 管理器 (v.2.4)。谁知道如何修复它?

答案1

我最近在 Ubuntu 16.04.1 上使用 conky 1.10.1 时遇到了同样的问题。我没有回滚 conky。我通过改变线路解决了这个问题

own_window_type = 'desktop',

在我的 .conkyrc 中

own_window_type = 'dock',

毕竟,我的 Ubuntu 16.04.1 的 .conkyrc 内容如下


os.execute("sleep 1")

conky.config = {
    background = true,
    double_buffer = true,
    alignment = 'top_right',
    border_width = 1,
    cpu_avg_samples = 2,
    default_color = 'white',
    default_outline_color = 'black',
    default_shade_color = 'black',
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_stderr = false,
    extra_newline = false,
    own_window = true,
    own_window_type = 'dock',
    own_window_transparent = false,
    own_window_argb_visual = true,
    own_window_argb_value = 64,
    own_window_colour = 'black',
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    minimum_width = 170, minimum_height = 0,
    stippled_borders = 0,
    update_interval = 2.0,
    uppercase = false,
    use_spacer = 'none',
    show_graph_scale = false,
    show_graph_range = false,
    use_xft = true,
    xftalpha = 0.1,
    font = 'Droid Sans:size=11',
    color0 = 'white',
    color1 = 'EAEAEA',
    color2 = 'FFA300',
    color3 = 'grey'
}

conky.text = [[
${font AvantGardeLTMedium:bold:size=11}${color Tan1}System ${color slate grey}${hr 2}${font}
${color1}Computer name      ${alignr}${color}${nodename}
${color1}Kernel version     ${alignr}${color}${kernel}-${machine}
${color1}CPU frequency      ${alignr}${color}${freq_g}GHz
${color1}Load (average)     ${alignr}${color}${loadavg 1}
${color1}CPU temperature    ${alignr}${color}${acpitemp} degrees Celsius

${if_existing /sys/class/power_supply/BAT0/uevent}${font AvantGardeLTMedium:bold:size=11}${color Tan1}Laptop battery charge ${color slate grey}${hr 2}${font}
${color1}Battery charge     ${alignr}${color}${battery BAT0}${endif}
${if_existing /sys/class/power_supply/BAT1/uevent}${font AvantGardeLTMedium:bold:size=11}${color Tan1}Laptop battery charge ${color slate grey}${hr 2}${font}
${color1}Battery charge     ${alignr}${color}${battery BAT1}${endif}

${font AvantGardeLTMedium:bold:size=11}${color Tan1}Processors ${color slate grey}${hr 2}${font}
${color1}Kernel 1     ${color}${cpu cpu1}%  ${cpubar cpu1}

${font AvantGardeLTMedium:bold:size=11}${color Tan1}Memory (RAM) ${color slate grey}${hr 2}${font}
${color1}Memory free / total ${alignr}${color}${memeasyfree} / ${memmax}
${color1}Now in use   ${color}${memperc}%   ${membar}
${color1}Virtual memory (swap)  ${alignc}${color}${swap} / ${swapmax} ${color}${alignr}${swapperc} %

${font AvantGardeLTMedium:bold:size=11}${color Tan1}File system ${color slate grey}${hr 2}${font}
${color1}Root or /       ${alignc}${color}${fs_used /} / ${fs_size /} ${color}${alignr}${fs_free_perc /} %
${color}${fs_bar 5,300 /}
${color1}Home or /home   ${alignc}${color}${fs_used /home} / ${fs_size /home} ${color}${alignr}${fs_free_perc /home} %
${color}${fs_bar 5,300 /home}

${font AvantGardeLTMedium:bold:size=11}${color Tan1}Wireless network ${color slate grey}${hr 2}${font}
${if_existing /proc/net/route wlp3s0}${color1}Wireless access point ${alignr}${color}${wireless_essid wlp3s0}${endif}
${color1}Signal strength     ${alignr}${color}${wireless_link_qual_perc wlp3s0}   ${wireless_link_bar 10,100 wlp3s0}
${color1}Data traffic down / up   ${alignr}${color}${totaldown wlp3s0}  ${color1}/  ${color}${totalup wlp3s0}
]]

我的 .conkyrc 产生如下输出:

在此处输入图片描述

答案2

目前,Conky 1.10 版本似乎已损坏,有些人正在恢复使用 1.9 版本。

我只能让其中几个运行,但要让其中几个运行,需要花费一些时间和调整。所以也许这是一个更好的选择,只需回滚,然后费尽心思让它们正常工作。

从:将 Conky 回滚至 1.9

  1. 查看我的 16.04(Xenial)机器上安装的 conky 版本:

    $ conky -v | head -n 1 | cut -d" " -f 2
    1.10.1
    
  2. 删除这个损坏的 conky 并清除它的配置和剩余的依赖项:

    sudo apt-get remove --purge conky-std && sudo apt-get autoremove
    
  3. 我想要 conky 版本 1.9,该版本不在 Ubuntu Xenial 存储库中,因此我获取了 Trusty 附带的软件包:

    wget http://security.ubuntu.com/ubuntu/pool/universe/c/conky/conky-std_1.9.0-4_amd64.deb
    
  4. 下载完 .deb 包后,我使用以下命令进行安装gdebi,这样dpkg它也会安装必要的依赖项:

    sudo gdebi conky-std_1.9.0-4_amd64.deb
    
  5. 检查已安装的版本:

    $ conky -v | head -n 1 | cut -d" " -f 2
    1.9.0
    
  6. 将软件包固定在 1.9.0 版本,以便将来的软件包更新不会让我们恢复到错误的版本:

    sudo apt-mark hold conky-std
    

是我现在正在做的工作。

相关内容