Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #261577

Re: xclip - how to use without a graphics display for testing on Github workflows

From Max Nikulin <manikulin@gmail.com>
Newsgroups linux.debian.user
Subject Re: xclip - how to use without a graphics display for testing on Github workflows
Date 2023-09-10 18:50 +0200
Message-ID <HcvNf-84my-1@gated-at.bofh.it> (permalink)
References <HcfIt-7TXS-7@gated-at.bofh.it> <Hci3E-7VrC-3@gated-at.bofh.it> <HcpeN-80fe-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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"

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

xclip - how to use without a graphics display for testing on Github workflows Tom Browder <tom.browder@gmail.com> - 2023-09-10 01:40 +0200
  Re: xclip - how to use without a graphics display for testing on  Github workflows Greg Wooledge <greg@wooledge.org> - 2023-09-10 01:50 +0200
    Re: xclip - how to use without a graphics display for testing on  Github workflows Tom Browder <tom.browder@gmail.com> - 2023-09-10 02:50 +0200
  Re: xclip - how to use without a graphics display for testing on  Github workflows Max Nikulin <manikulin@gmail.com> - 2023-09-10 04:10 +0200
    Re: xclip - how to use without a graphics display for testing on  Github workflows Tom Browder <tom.browder@gmail.com> - 2023-09-10 11:50 +0200
      Re: xclip - how to use without a graphics display for testing on  Github workflows Max Nikulin <manikulin@gmail.com> - 2023-09-10 18:50 +0200
        Re: xclip - how to use without a graphics display for testing on  Github workflows Tom Browder <tom.browder@gmail.com> - 2023-09-11 12:30 +0200

csiph-web