Skip to content

Drop hard xclip dependency#68

Open
tom-mi wants to merge 2 commits intoTNG:mainfrom
tom-mi:feat-drop-xclip-dependency
Open

Drop hard xclip dependency#68
tom-mi wants to merge 2 commits intoTNG:mainfrom
tom-mi:feat-drop-xclip-dependency

Conversation

@tom-mi
Copy link
Copy Markdown

@tom-mi tom-mi commented Apr 24, 2026

As discussed in #67

  • adapt debian dependencies
  • allow xsel as well (adapting both Debian & Arch dependencies again)

Works locally installing the .deb in Debian 13 (I did not test it on Arch, but the package is also called xsel in Arch, so I don't expect any surprises)


Note

Low Risk
Low risk: packaging metadata and a small Linux clipboard fallback change; main command-generation logic is untouched.

Overview
Drops the hard Debian dependency on xclip by moving clipboard tools to suggested/optional dependencies (Suggests: xsel, xclip, wl-clipboard) and updating the Arch PKGBUILD optdepends to prefer xsel with xclip as fallback.

Updates please.sh clipboard handling on Linux/X11 to try xsel first, then xclip, and improves the error message when neither is installed.

Reviewed by Cursor Bugbot for commit fb21779. Bugbot is set up for automated code reviews on this repo. Configure here.

tom-mi added 2 commits April 24, 2026 16:24
* move to suggests (similar to the optional dependency of the Arch
  PKGBUILD)

Signed-off-by: Thomas Reifenberger <thomas.reifenberger@tngtech.com>
Signed-off-by: Thomas Reifenberger <thomas.reifenberger@tngtech.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates packaging and clipboard integration to remove a hard dependency on xclip, allowing xsel/xclip/wl-clipboard to be optional and used as available.

Changes:

  • Linux/X11 clipboard fallback now tries xsel first, then xclip, with an updated error message when neither is available.
  • Arch packaging metadata updated to prefer xsel with xclip as a fallback.
  • Debian package metadata updated to drop xclip from Depends and add clipboard tools under Suggests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
please.sh Updates X11 clipboard handling to prefer xsel and improves missing-tool messaging.
PKGBUILD Adjusts optdepends to list xsel preferred and xclip as fallback.
.github/workflows/create-release.yml Updates Debian control metadata to move clipboard tools to Suggests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread please.sh
@@ -403,10 +403,12 @@ copy_to_clipboard() {
if [ "$XDG_SESSION_TYPE" == "wayland" ]; then
echo -n "${command}" | wl-copy --primary
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Wayland, this calls wl-copy unconditionally. Since wl-clipboard is now an optional dependency (Suggests/optdepends), this can fail with a plain "command not found". Consider mirroring the X11 logic by checking for wl-copy (and optionally wl-paste) with command -v and emitting a clear error message when missing.

Suggested change
echo -n "${command}" | wl-copy --primary
if command -v wl-copy &> /dev/null; then
echo -n "${command}" | wl-copy --primary
else
echo "wl-copy is not installed. Please install wl-clipboard to copy to the clipboard on Wayland. Exiting."
exit 1
fi

Copilot uses AI. Check for mistakes.
Comment thread please.sh
Comment on lines +411 to 412
echo "Neither xsel nor xclip is installed. Exiting."
exit 1
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message is written to stdout. For an error path that exits non-zero, it should go to stderr (e.g., redirect the echo) so users can pipe/parse normal output reliably.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants