diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2013-09-30 15:53:25 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2013-09-30 16:08:35 +0200 |
commit | 539deef6ed651d14691f6721ccb9979ca6cfc8e3 (patch) | |
tree | d03b645ab9a8cb1762c8c24a6693d49f95530a0a | |
parent | 975b68f3d8e3c9030d7f3c284e4e83d3667da13c (diff) | |
download | dotfiles-539deef6ed651d14691f6721ccb9979ca6cfc8e3.tar.gz dotfiles-539deef6ed651d14691f6721ccb9979ca6cfc8e3.tar.bz2 dotfiles-539deef6ed651d14691f6721ccb9979ca6cfc8e3.zip |
wgetpaste support for urxvt.
Diffstat (limited to '')
-rw-r--r-- | .Xresources | 3 | ||||
-rw-r--r-- | .urxvt/extensions/wgetpaste | 26 |
2 files changed, 28 insertions, 1 deletions
diff --git a/.Xresources b/.Xresources index fcd6bb6..7bf7bea 100644 --- a/.Xresources +++ b/.Xresources @@ -23,7 +23,8 @@ URxvt.keysym.Shift-Up: command:\033]720;1\007 URxvt.keysym.Shift-Down: command:\033]721;1\007 ! perl-modules -URxvt.perl-ext-common: default,url-select,clipboard,selection-autotransform +URxvt.perl-lib: /home/necoro/.urxvt/extensions/ +URxvt.perl-ext-common: default,url-select,clipboard,selection-autotransform,wgetpaste ! allow Alt-V/-C for pasting from/copying to clipboard URxvt.keysym.M-v: perl:clipboard:paste diff --git a/.urxvt/extensions/wgetpaste b/.urxvt/extensions/wgetpaste new file mode 100644 index 0000000..7462319 --- /dev/null +++ b/.urxvt/extensions/wgetpaste @@ -0,0 +1,26 @@ +#! perl -w + +# Adds an entry to the selection popup allowing to move the current selection +# to a pastebin via wgetpaste. +use IPC::Open2; + +sub on_start { + my ($self) = @_; + + push @{ $self->{term}{selection_popup_hook} }, sub { ("Pastebin" => \&wgetpaste) } + if `which wgetpast 2> /dev/null`; + + return () +} + +sub wgetpaste { + my ($pout, $pin); + + my $pid = open2($pout, $pin, 'wgetpaste'); + print $pin $_; + close $pin; + + $_ = <$pout>; + + s/^.*?://; +} |