From 85d8aa9833e591ba5950d0e4d118ed21f6ab2a97 Mon Sep 17 00:00:00 2001 From: Jakub Date: Wed, 11 Jan 2023 10:49:08 -0500 Subject: [PATCH] change dmenu flags to fit my builds requires modified version restrict return - see my dmenu build for details recommended to add -i if you don't use case insensitive patch in dmenu --- st-copyout | 2 +- st-urlhandler | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/st-copyout b/st-copyout index 326edd2..29a829b 100755 --- a/st-copyout +++ b/st-copyout @@ -8,6 +8,6 @@ trap 'rm "$tmpfile"' 0 1 15 sed -n "w $tmpfile" sed -i 's/\x0//g' "$tmpfile" ps1="$(grep "\S" "$tmpfile" | tail -n 1 | sed 's/^\s*//' | cut -d' ' -f1)" -chosen="$(grep -F "$ps1" "$tmpfile" | sed '$ d' | tac | dmenu -p "Copy which command's output?" -i -l 10 | sed 's/[^^]/[&]/g; s/\^/\\^/g')" +chosen="$(grep -F "$ps1" "$tmpfile" | sed '$ d' | tac | dmenu -p "Copy which command's output?" -R | sed 's/[^^]/[&]/g; s/\^/\\^/g')" eps1="$(echo "╭─" | sed 's/[^^]/[&]/g; s/\^/\\^/g')" awk "/^$chosen$/{p=1;print;next} p&&/$eps1/{p=0};p" "$tmpfile" | xclip -selection clipboard diff --git a/st-urlhandler b/st-urlhandler index bd4b168..588a52a 100755 --- a/st-urlhandler +++ b/st-urlhandler @@ -13,8 +13,8 @@ urls="$(sed 's/.*│//g' | tr -d '\n' | # First remove linebreaks and mutt sideb while getopts "hoc" o; do case "${o}" in h) printf "Optional arguments for custom use:\\n -c: copy\\n -o: xdg-open\\n -h: Show this message\\n" && exit 1 ;; - o) chosen="$(echo "$urls" | dmenu -i -p 'Follow which url?' -l 10)" + o) chosen="$(echo "$urls" | dmenu -p 'Follow which url?' -R )" setsid xdg-open "$chosen" >/dev/null 2>&1 & ;; - c) echo "$urls" | dmenu -i -p 'Copy which url?' -l 10 | tr -d '\n' | xclip -selection clipboard ;; + c) echo "$urls" | dmenu -p 'Copy which url?' -R | tr -d '\n' | xclip -selection clipboard ;; *) printf "Invalid option: -%s\\n" "$OPTARG" && exit 1 ;; esac done