Hi, If I see that correctly your dmenu can be either in "display message" or "menu" mode. I think you should rather split them into two single programs, one for displaying messages and the other one for being a menu. UNIX teaches us to do one thing well instead of clogging everything into a single binary. However, this is just my personal opinion. Against which version of dmenu is the diff? tip? latest release?
Best, Moritz