dzen icon indicating copy to clipboard operation
dzen copied to clipboard

Strange behavior of dzen2 menu stdout

Open Mesibov opened this issue 6 years ago • 1 comments

This command generates a 3-item horizontal menu, with "menuprint" sending the left-click choice to stdout:

echo -e "xterm\nxeyes\nxfontsel" | dzen2 -x 450 -y 450 -w 250 -l 3 -m h -sa c -p -e "button1=menuprint;button3=exit:13"

If I left-click on each item in turn, I get

xterm xeyes xfontsel

In the following command, stdout is piped to sed:

echo -e "xterm\nxeyes\nxfontsel" | dzen2 -x 450 -y 450 -w 250 -l 3 -m h -sa c -p -e "button1=menuprint;button3=exit:13" | sed 's/xeyes/aaaaa/'

Clicking on each item in turn gives

xterm aaaaa xfontsel

But not all downstream processes accept stdout the way sed does in the example. Neither

echo -e "xterm\nxeyes\nxfontsel" | dzen2 -x 450 -y 450 -w 250 -l 3 -m h -sa c -p -e "button1=menuprint;button3=exit:13" | xclip

nor

echo -e "xterm\nxeyes\nxfontsel" | dzen2 -x 450 -y 450 -w 250 -l 3 -m h -sa c -p -e "button1=menuprint;button3=exit:13" | xsel

sends the menu choice to the X clipboard.

Any suggestions about what's going on here? Many thanks in advance.

Mesibov avatar Feb 26 '19 06:02 Mesibov

I think what's happening is that dzen2 is "claiming" the X buffer while it's running, and blocking use by xclip and xsel!

Mesibov avatar Feb 27 '19 07:02 Mesibov