Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix xclip not working on xorg and add Windows support #3

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

elliotwutingfeng
Copy link

@elliotwutingfeng elliotwutingfeng commented Feb 6, 2024

Proposed changes

  • The clipboard copy feature doesn't work on my Linux xorg machine unless I add cmd += " -selection clipboard".

    System details

    OS: Manjaro Linux amd64
    Desktop Environment: GNOME xorg
    Kernel: 6.6.10-1-MANJARO
    xclip version: xclip-0.13-4

    Not sure if this is a distro-specific issue.

  • If none of the 3 UNIX clipboard programs ("xclip", "wl-copy", "pbcopy") are present, then we fallback to this cross-platform clipboard package which works on Windows, and if that also fails to initialize, then the copy function is disabled.

    image
    Working clipboard copy on Windows 10 amd64 PowerShell

  • Bumped GitHub Actions as Node 16 is deprecated, and Go 1.22 has been released.

Additional information about Go clipboard

It works out of the box on Windows with no dependencies or compilation tweaks.

Dependency

    macOS: require Cgo, no dependency
    Linux: require X11 dev package. For instance, install libx11-dev or xorg-dev or libX11-devel to access X window system.
    Windows: no Cgo, no dependency
    iOS/Android: collaborate with [gomobile](https://golang.org/x/mobile)

Known issues

  • Password stdin input fails on MINGW64 for Windows.
  • json.Unmarshal fails on 32-bit systems; can be rectified by switching to int64 type.
  • Tick icon font missing ? on Windows 10 when copied to clipboard.

@elliotwutingfeng elliotwutingfeng marked this pull request as draft February 7, 2024 09:32
@elliotwutingfeng elliotwutingfeng marked this pull request as ready for review February 7, 2024 10:09
@elliotwutingfeng elliotwutingfeng changed the title Fix xclip not working on xorg Fix xclip not working on xorg and add Windows support Feb 7, 2024
@elliotwutingfeng elliotwutingfeng marked this pull request as draft February 7, 2024 18:06
@elliotwutingfeng elliotwutingfeng marked this pull request as ready for review February 8, 2024 06:54
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.

1 participant