does pipe to xclip work with clipboard manager?

  Kiến thức lập trình

OS: ubuntu 22.04

I can’t seem to get command output to pipe thru xclip to the clipboard (copyq).

I have this zsh/bash alias:

pw () {
    pwgen -sync "${1:-48}" -1 | xclip -o
}

and although the generated passwd outputs to the terminal (xclip -o option), nothing shows up on my clipboard manager (copyq).

and for S&Gs I also have this alias: alias pww="pwgen -sync ${1:-48} -1 | xclip -o" to try something different, but unfortunately same result.

But if I kill copyq, and then run the alias, the generated pw shows up on the terminal and can be pasted from whatever the shell’s default clipboard is.

So, it would seem to be some hangup between xclip and copyq.

Surely xclip is intended to work with clipboard managers. If so, does anyone have any ideas what I am missing or maybe need to setup to get term output to pipe to copyq via xclip?

LEAVE A COMMENT