brndnmtthws / conky

Light-weight system monitor for X, Wayland (sort of), and other things, too
https://conky.cc
GNU General Public License v3.0
7.17k stars 615 forks source link

Error when closing the X session #1191

Closed ghost closed 5 months ago

ghost commented 2 years ago

Issue

When I exit the openbox session I get this error in console: xinit: connection to X server lost Waiting for the X server to shut down conky: X error: Display ..........

Information

OS: Arch Linux, CPU: Intel Celeron x2 GPU: Intel UHD 600 GFX. No desktop environment and display manager, just using Openbox as window manager.

My .conkyrc

conky.config = {
    alignment = 'top_right',
    background = true,
    double_buffer = true,
    border_width = 0,
    cpu_avg_samples = 4,
    default_color = 'silver',
    default_outline_color = 'white',
    default_shade_color = 'red',
    draw_borders = false,
    draw_graph_borders = false,
    draw_outline = false,
    draw_shades = false,
--gap_x 1520
    gap_x = 11,
    gap_y = 12,
    net_avg_samples = 4,
    no_buffers = true,
    out_to_console = false,
    out_to_stderr = false,
    extra_newline = false,
    own_window = false,
    own_window_type = 'desktop',
    own_window_transparent = true,
--  own_window_colour = false,
    own_window_argb_visual = false,
    own_window_argb_value = 0,
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    minimum_width = 50,
    stippled_borders = 0,
    update_interval = 3,
    uppercase = false,
    use_spacer = 'none',
    show_graph_scale = true,
    show_graph_range = false,
    use_xft = true,
    xftalpha = 0.2,
    font = 'Liberation Sans:size=10',
--color0 FFBB00
--color1 FFFFF7
--color2 FFCC44
--color3 FFCC99
--color4 FFDD11
    color0 = '#FFAA44',
    color1 = '#FFFFE3',
    color2 = '#FFB943',
    color3 = '#FFCC44',
    color4 = '#FFFFF9',
};

conky.text = [[
${font Liberation Sans:size=9}${color2}${sysname}   ${kernel}  Hostname ${exec hostname}
${font Liberation Mono:size=8}${color3}${exec lscpu | grep 'Model name' | cut -c 34- }
${font Liberation Sans:size=12}${color4}${time %A} ${time %d} ${time %B} ${time %Y}  ${time %I:%M} 
${font Liberation Sans:size=10}${color2}CPU${exec lscpu | grep 'Model name' | cut -c 22- | cut -d' ' -f1-4}:$color1 $cpu% ${cpubar 8}
${font Liberation Sans:size=10}
${color2}Frequency:$color1 ${freq_g}GHz  ${color2}Temperature:${color1} ${acpitemp}°C
${color2}Frequency:$color1 ${freq_g}GHz  ${color2}Temp1:${color1} ${cat  /sys/class/thermal/thermal_zone0/hwmon0/temp1_input}°C
#                                 ${color2}Temp2:${color1} ${cat /sys/class/thermal/thermal_zone0/hwmon0/temp2_input}/1000°C
${color2}RAM:$color1 ${mem}/${memmax} - ${memperc}% ${membar 8}
${color2}Swap:$color1 $swap/$swapmax - $swapperc% ${swapbar 8}
${font Liberation Sans:size=10}${color2}Processes:${font Liberation Sans:size=9}$color1 $processes  ${color2}Running:$color1 $running_processes:${color2}Uptime:$color1 $uptime
${font Liberation Sans:size=10}${color2}File system: $color1${fs_used /}/${fs_size /} ${fs_bar 8 /}
#${color1}Wifi signal: $color${wireless_link_qual_perc wlan0}%
${color2}Ethernet Up:$color1 ${upspeedf eth0} ${color2} Down:$color1 ${downspeedf eth0}
${color2}Downloaded: $color1${totaldown eth0} $alignr ${color2}Uploaded: $color1${totalup eth0} 

${color0}CPU ${color1}${alignr}${cpu cpu0}%
${cpubar cpu0 8,}
#${cpubar cpu1 3,}
#${cpubar cpu2 3,}
#${cpubar cpu3 3,}
#${cpubar cpu4 3,}
#${cpubar cpu5 3,}
#${cpubar cpu6 3,}
#${cpubar cpu7 3,}
${color1}${top name 1} $alignr ${top cpu 1}%
${top name 2} $alignr ${top cpu 2}%
${top name 3} $alignr ${top cpu 3}%
${top name 4} $alignr ${top cpu 4}%
${top name 5} $alignr ${top cpu 5}%
${top name 6} $alignr ${top cpu 6}%
${top name 7} $alignr ${top cpu 7}%
${top name 8} $alignr ${top cpu 8}%
${top name 9} $alignr ${top cpu 9}%
${top name 10} $alignr ${top cpu 10}%

${color0}RAM ${color1}${alignr}${Mem}
${membar 8,}
${color1}${top_mem name 1} $alignr ${top_mem mem_res 1}
${top_mem name 2} $alignr ${top_mem mem_res 2}
${top_mem name 3} $alignr ${top_mem mem_res 3}
${top_mem name 4} $alignr ${top_mem mem_res 4}
${top_mem name 5} $alignr ${top_mem mem_res 5}
${top_mem name 6} $alignr ${top_mem mem_res 6}
${top_mem name 7} $alignr ${top_mem mem_res 7}
${top_mem name 8} $alignr ${top_mem mem_res 8}
${top_mem name 9} $alignr ${top_mem mem_res 9}
${top_mem name 10} $alignr ${top_mem mem_res 10}

#${color0}${font Liberation Sans:size=8}66-services under tree
#${color0}${font Liberation Mono:size=7}${exec sudo 66-intree -v3 -zg -d 2 net}
#${color1}${font Liberation Sans:size=8}${exec /usr/local/bin/wx}
${color2}${font Liberation Sans:size=11}Running Services
${color0}${font Liberation Mono:size=10}${exec ps -A | grep dhclient }
${color0}${font Liberation Mono:size=10}${exec ps -A | grep ntpd }
${color0}${font Liberation Mono:size=10}${exec ps -A | grep dbus }
${color0}${font Liberation Mono:size=10}${exec ps -A | grep sshd }
#${color0}${font Liberation Mono:size=10}${exec ps -A | grep pcmanfm }
${color0}${font Liberation Mono:size=10}${exec ps -A | grep tor }
#${color0}${font Liberation Mono:size=10}${exec ps -A | grep wpa }
#${color0}${font Liberation Mono:size=10}${exec free -m}
]];
bi4k8 commented 1 year ago

This is the message Conky prints when the X server exits out from under it: https://github.com/brndnmtthws/conky/blob/a39015b7bd01d62fb254bb186c8533d934fb50cd/src/x11.cc#L230-L233

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days.

Caellian commented 5 months ago

The reason this happens is because conky doesn't get terminated by the WM on shutdown. I'm assuming that the init script (or system(d)) you use starts conky independently of the WM - if possible, you should start conky from your WMs init script, which would make it close with the WM, before X server closes.

Closing as this can't be fixed from conky side in a way that's reasonable.