Score:1

Conky warning: invalid head index

de flag

my Conky still echoes 'invalid head index' during console tests.

Generally, It starts without any problems with my OS: 5.8.0-63-generic #71~20.04.1-Ubuntu SMP Thu Jul 15 17:46:08 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux, effectively executing bash file '~/conkystartup.sh' at every startup:

#!/bin/bash
sleep 15
dir=~/.config/conky
cnf=${dir}/conky.conf
log=${dir}/conky.log
dat=$(date +%x-%X)
# execute command and append result in log file
if 
conky -d -c $cnf; then
    echo $dat " conky start succeed " >> $log
else 
    echo $dat  " ---- conky failed!!! " >> $log
fi

configured in '~/.config/conky/conky.conf' as follows:

conky.config = {

background = false,
update_interval = 1,
double_buffer = true,
no_buffers = true,
text_buffer_size = 2048,
own_window = true,
own_window_class = 'conky',
own_window_argb_visual = true,
own_window_argb_value = 50,
own_window_hints = 'undecorated,above,sticky,skip_taskbar,skip_pager',
own_window_colour = '#252525',
own_window_type = 'normal',
background = false,
minimum_width = 80,
alignment = 'bottom_right',
xinerama_head = 2,    
gap_x = 10,
gap_y = 10,
draw_shades = false,
draw_outline = false,
draw_borders = false,
override_utf8_locale = true,
use_xft = true,
font = 'Noto:size=24',
xftalpha = 0.5,
uppercase = false
};
conky.text = [[
${font Noto:size=24}${color white}${offset 0}${color white}${time %H}:${time %M}
${voffset -18}${offset 3}${font Noto:size=10}${color white}${time %e} ${time %b} ${time %A}
]];

please find enclosed all echo lines after console test triggered by direct command '~$ sh conkystartup.sh ':

conky: warning: invalid head index, ignoring head settings
conky: warning: invalid head index, ignoring head settings
conky: desktop window (600010) is subwindow of root window (178)
conky: window type - normal
conky: drawing to created window (0x3e00002)
conky: drawing to double buffer
conky: forked to background, pid is 4525

Each invoked test is of course preceded by the command '$ killall conky'.

Thank you in advance for your reliable comments :)

===

edit 27-07-2021 - Solution:

My displays:

|-----------| |-----------------|
|0(laptop)  | |1(LCDtv)         |
|           | |                 |
|           | |                 |
|           | |             time|
|-----------| |-----------------|

After change in the line 'xinerama_head = 2,' -> 'xinerama_head = 1,' of 'conky.conf' the console result test '$ conky -d -c ~/.config/conky/conky.conf' is:

conky: desktop window (600010) is subwindow of root window (178)
conky: window type - normal
conky: drawing to created window (0x3800002)
conky: drawing to double buffer
conky: forked to background, pid is 5793

No warnings - expected result achieved! Thank you :)

David avatar
cn flag
That is not the OS that is the kernel version and could be from a few different OS
Lorenz Keel avatar
gr flag
the problem is probably in `xinerama_head = 2`, it is useful in multi-monitor setup. Do you have a second monitor? If not, try to comment that line. Consider also that it is simply a warning, not an error.
meuh avatar
cn flag
Yes, @LorenzKeel, you can see the message in the source code [x11.cc](https://github.com/brndnmtthws/conky/blob/main/src/x11.cc#L470) when setting up Xinerama.
Score:1
gr flag

The xinerama_head option is useful in a multi-display setup. The value that you put in that variable is the index (starting from zero) of the display where you want that the conky panel appears.

The warning tells you that you are using an index that does not correspond to any display. This is visible from the conky source code (thanks to meuh for his comment), where the check of the maximum number of available displays may triggers your warning:

  int i = head_index.get(*state);
  if (i < 0 || i >= heads) {
    NORM_ERR("warning: invalid head index, ignoring head settings");
    return;
  }

Remove/comment the xinerama_head = 2 line, or put an appropriate number for your setup.

Andrzej Więcławski avatar
de flag
Yes! after change the line: xinerama_head = 2, -> xinerama_head = 1, there are no warnings any more :) Of course, my second display (LCD TV via hdmi) has index 1 - my mistake.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.