]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Fix(xclip): avoid 'Error: target STRING not available' (4)
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 22 Aug 2022 16:23:07 +0000 (13:23 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 22 Aug 2022 16:23:07 +0000 (13:23 -0300)
lib/keyringer/actions/xclip

index d1d85b52bd7a34e2afd09221e6b43b36a2ebb370..ff82cc1821d89cf7a36602e5e7365955f811f5f7 100755 (executable)
@@ -16,14 +16,14 @@ clip() {
 
   #local xclip="xclip -selection clipboard"
   local xclip="xclip"
-  before="$($xclip -o | base64)"
+  before="$($xclip -o 2> /dev/null | base64)"
 
   # Avoid "Error: target STRING not available"
   # https://github.com/astrand/xclip/issues/38
   echo "$RANDOM" | $xclip &> /dev/null
 
   # Copy text into clipboard
-  echo -n "$1" | $xclip
+  echo -n "$1" | $xclip &> /dev/null
 
   # Cleanup procedure
   (