{"body":".tell antononcube gist for xclip mockup for Debian: #== From: Max Nikulin <manikulin@gmail.com>\n#== Subject: Re: xclip - how to use without a graphics display for testing on Github workflows\n#== Date: Sun, 10 Sep 2023 23:48:28 +0700\n#== Content-Type: text/plain; charset=UTF-8; format=flowed\n#== Content-Transfer-Encoding: 7bit\n#== Resent-From: debian-user@lists.debian.org\n#== X-Mailing-List: <debian-user@lists.debian.org> archive/latest/803232\n#== X-Loop: debian-user@lists.debian.org\n#== List-Id: <debian-user.lists.debian.org>\n#== List-URL: <https://lists.debian.org/debian-user/>\n#== Resent-Date: Sun, 10 Sep 2023 16:49:01 +0000 (UTC)\n#\n# On 10/09/2023 16:44, Tom Browder wrote:\n# > On Sat, Sep 9, 2023 at 21:06 Max Nikulin wrote:\n# >\n# >> You can create a mock-up and use it instead of real xclip binary.\n# >\n# > Sounds interesting, Max, can you show the code?\n#\n# Unless you need to test subtle issues like\n#\n#    https://github.com/astrand/xclip/issues/20\n#    \"Not closing stdout when setting clipboard from stdin\"\n#\n# faced by e.g. tmux users, something simple should be enough:\n\n#!/bin/sh -eu\n: \"${XCLIP_MOCK_FILE:=$HOME/.xclip-mock}\"\n\nwhile [ $# -gt 0 ]; do\n\tcase \"$1\" in\n\t\t-i|-in)\n\t\t\t;;\n\t\t-o|--out) exec cat -- \"$XCLIP_MOCK_FILE\"\n\t\t\t;;\n\t\t-selection|-target) shift\n\t\t\t;;\n\t\t*) # FIXME xclip treats all unknown options at any position as files\n\t\t\tbreak\n\t\t\t;;\n\tesac\n\tshift\ndone\nexec cat -- \"$@\" >\"$XCLIP_MOCK_FILE\"\n","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/w1yhM4Nc","modified":1694440044,"id":"w1yhM4Nc","size":1425,"lines":44,"own_paste":false,"theme":"","date":1694440044}