Created
May 8, 2014 21:02
-
-
Save stelonix/5a275b76215f4526f2fe to your computer and use it in GitHub Desktop.
urxvt clipboard access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! perl | |
# source: https://bbs.archlinux.org/viewtopic.php?pid=619931#p619931 | |
sub on_sel_grab { | |
my $query = quotemeta $_[0]->selection; | |
$query =~ s/\n/\\n/g; | |
$query =~ s/\r/\\r/g; | |
system( "echo -en " . $query . " | xsel -ibp" ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment