Re: xclip - how to use without a graphics display for testing on Github workflows
On Sun, Sep 10, 2023 at 11:49 Max Nikulin wrote: > On 10/09/2023 16:44, Tom Browder wrote: > > On Sat, Sep 9, 2023 at 21:06 Max Nikulin wrote: > > > >> You can create a mock-up and use it instead of real xclip binary. > > > > Sounds interesting, Max, can you show the code? > > Unless you need to test subtle issues like > >https://github.com/astrand/xclip/issues/20 >"Not closing stdout when setting clipboard from stdin" > > faced by e.g. tmux users, something simple should be enough: > > #!/bin/sh -eu > : "${XCLIP_MOCK_FILE:=$HOME/.xclip-mock}" > > while [ $# -gt 0 ]; do > case "$1" in > -i|-in) > ;; > -o|--out) exec cat -- "$XCLIP_MOCK_FILE" > ;; > -selection|-target) shift > ;; > *) # FIXME xclip treats all unknown options at any > position as files > break > ;; > esac > shift > done > exec cat -- "$@" >"$XCLIP_MOCK_FILE" Thank, Max! I'll pass it on to the guy who needs it. He slings Wolfram language code for a living. Best regards, -Tom
Re: xclip - how to use without a graphics display for testing on Github workflows
On 10/09/2023 16:44, Tom Browder wrote: On Sat, Sep 9, 2023 at 21:06 Max Nikulin wrote: You can create a mock-up and use it instead of real xclip binary. Sounds interesting, Max, can you show the code? Unless you need to test subtle issues like https://github.com/astrand/xclip/issues/20 "Not closing stdout when setting clipboard from stdin" faced by e.g. tmux users, something simple should be enough: #!/bin/sh -eu : "${XCLIP_MOCK_FILE:=$HOME/.xclip-mock}" while [ $# -gt 0 ]; do case "$1" in -i|-in) ;; -o|--out) exec cat -- "$XCLIP_MOCK_FILE" ;; -selection|-target) shift ;; *) # FIXME xclip treats all unknown options at any position as files break ;; esac shift done exec cat -- "$@" >"$XCLIP_MOCK_FILE"
Re: xclip - how to use without a graphics display for testing on Github workflows
On Sat, Sep 9, 2023 at 21:06 Max Nikulin wrote: > On 10/09/2023 06:36, Tom Browder wrote: > > We have a Raku module that uses "xclip" during use on a computer with a > > monitor. We need to test it with Github workflows which does not have a > > graphics device. > > > > Is there any "xclip" option to allow for testing without a graphics > > devivce without throwing an error? Or any suggestion for a work around? > > You can create a mock-up and use it instead of real xclip binary. Sounds interesting, Max, can you show the code? Thanks. Cheers! -Tom
Re: xclip - how to use without a graphics display for testing on Github workflows
On 10/09/2023 06:36, Tom Browder wrote: We have a Raku module that uses "xclip" during use on a computer with a monitor. We need to test it with Github workflows which does not have a graphics device. Is there any "xclip" option to allow for testing without a graphics devivce without throwing an error? Or any suggestion for a work around? You can create a mock-up and use it instead of real xclip binary.
Re: xclip - how to use without a graphics display for testing on Github workflows
On Sat, Sep 9, 2023 at 18:47 Greg Wooledge wrote: > On Sat, Sep 09, 2023 at 06:36:56PM -0500, Tom Browder wrote: > > Is there any "xclip" option to allow for testing without a graphics > devivce … Thanks, Greg! -Tom
Re: xclip - how to use without a graphics display for testing on Github workflows
On Sat, Sep 09, 2023 at 06:36:56PM -0500, Tom Browder wrote: > Is there any "xclip" option to allow for testing without a graphics devivce > without throwing an error? Or any suggestion for a work around? Look at the xvfb package. It gives an X server that exists entirely in memory, not needing a physical graphics chipset to run against. You can set DISPLAY to point to the xvfb server, and run X client programs in that environment.