My dotfiles for my Linux rice managed with stow and make
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xclipboard 404B

123456789101112131415161718
  1. #! perl
  2. sub on_sel_grab {
  3. my $query = $_[0]->selection;
  4. open (my $pipe,'| /usr/bin/xclip -in -selection clipboard') or die;
  5. print $pipe $query;
  6. close $pipe;
  7. }
  8. sub paste {
  9. my ($self) = @_;
  10. my $content = `/usr/bin/xclip -loop 1 -out -selection clipboard`;
  11. $self->tt_write ($content);
  12. }
  13. sub on_user_command {
  14. my ($self, $cmd) = @_;
  15. if ($cmd eq "clipboard:paste") {
  16. $self->paste;
  17. }
  18. }