diff options
Diffstat (limited to '.config/nnn/plugins/joe_clipper')
-rwxr-xr-x | .config/nnn/plugins/joe_clipper | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/.config/nnn/plugins/joe_clipper b/.config/nnn/plugins/joe_clipper index 8c0fa5d..54d8095 100755 --- a/.config/nnn/plugins/joe_clipper +++ b/.config/nnn/plugins/joe_clipper @@ -1,9 +1,12 @@ #!/usr/bin/env perl + use strict; use warnings; use Cwd qw(cwd); +use constant XCLIP => 'xclip -selection clipboard '; + sub close_io { open STDIN, '<', '/dev/null' or die $!; @@ -19,7 +22,7 @@ sub clip_img $pid = fork(); if ($pid == 0) { - system("magick $file png:- | xclip -selection clipboard -t image/png"); + system("magick '$file' png:- | " . XCLIP . "-t image/png"); exec( 'notify-send', '-t', '2000', @@ -38,7 +41,7 @@ sub clip_raw $pid = fork(); if ($pid == 0) { - system( "xclip -selection clipboard $file"); + system( "xclip -selection clipboard '$file'"); exec( 'notify-send', '-t', '2000', |