aboutsummaryrefslogtreecommitdiffstats
path: root/st-cpyout
diff options
context:
space:
mode:
authorjoe <rbo@gmx.us>2025-09-27 21:50:18 +0200
committerjoe <rbo@gmx.us>2025-09-27 21:50:18 +0200
commit951cf37bd0f80f19120b2bbd8e0d3f4a47045d16 (patch)
tree546b3891acb48d77a2b2452cf5574cb981e25ec4 /st-cpyout
parentup (diff)
downloadst-951cf37bd0f80f19120b2bbd8e0d3f4a47045d16.tar.gz
st-951cf37bd0f80f19120b2bbd8e0d3f4a47045d16.tar.bz2
st-951cf37bd0f80f19120b2bbd8e0d3f4a47045d16.tar.xz
st-951cf37bd0f80f19120b2bbd8e0d3f4a47045d16.tar.zst
st-951cf37bd0f80f19120b2bbd8e0d3f4a47045d16.zip
good
Diffstat (limited to 'st-cpyout')
-rwxr-xr-xst-cpyout5
1 files changed, 2 insertions, 3 deletions
diff --git a/st-cpyout b/st-cpyout
index b894534..c1fa1a1 100755
--- a/st-cpyout
+++ b/st-cpyout
@@ -5,11 +5,10 @@
# xclip required for this script.
# By Jaywalker and Luke
# Adapted for FreeBSD by Joe
-mem=$(cat)
-mem=$(printf "%s" "$mem" | sed 's/\x0//g')
+mem=$(sed 's/^ $//g' | sed 's/\x0//g')
ps1=$(printf "%s" "$mem" |
tail -n1 |
- sed 's/%.\+/%/')
+ sed -E 's/([%,#,>]).*/\1/')
chosen=$(printf "%s" "$mem" |
grep -F "$ps1" |
sed '$ d' |