aboutsummaryrefslogtreecommitdiffstats
path: root/st-cpycmd
diff options
context:
space:
mode:
Diffstat (limited to 'st-cpycmd')
-rwxr-xr-xst-cpycmd8
1 files changed, 6 insertions, 2 deletions
diff --git a/st-cpycmd b/st-cpycmd
index 3fb38c4..a449364 100755
--- a/st-cpycmd
+++ b/st-cpycmd
@@ -9,11 +9,15 @@ mem=$(sed '{s/^ $//g;s/\x0//g;}')
ps1=$(printf "%s" "$mem" |
tail -n1 |
sed -E 's/([%,#,>,$]).*/\1/')
+printf "%s" "$mem" |
+ grep -F "$ps1" |
+ grep -v "$ps1 $" |
+return
chosen=$(printf "%s" "$mem" |
grep -F "$ps1" |
- sed '$ d' |
+ grep -v "$ps1 $" |
tac |
- dmenu -i -l 10 -m 0)
+ dmenu -i -l 10)
if [ -n "$chosen" ]; then
cmd=$(printf "%s" "$chosen" | sed "{s/^$ps1 //;s/ $//;}")
printf "%s" "$cmd" | xclip -selection clipboard