User Tools

Site Tools


google_clip

Google Clip

Search google for what's in your clipboard.

The Script

Put this in google_clip.pl.

#!/usr/bin/perl                                                                                                                                                                         
 
use strict;
use warnings;
 
use URI::Escape;
 
my $query = `xclip -selection primary -o`;
$query = uri_escape($query);
$query = "http://www.google.com/search?q=$query";
my $socket = $ARGV[3];
my $sh;
open $sh, '>', $socket or die "Could not open '$socket': $!\n";
print $sh "uri $query\n";
close $sh;

Bindings

I use:

bind    gp        = spawn $XDG_DATA_HOME/uzbl/scripts/google_clip.pl
google_clip.txt · Last modified: 2016/08/31 14:10 (external edit)