sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 173c58bffc78e64227b0976a66d766642fea3cb0
parent c21c6ec3a3d283e54c8329ed4dcb254d66750f4b
Author: Miles Alan <m@milesalan.com>
Date:   Sun, 11 Aug 2019 22:42:03 -0500

Fix a few minor bugs and add info in comments to externalpipe_buffer.sh script

Diffstat:
Mst.suckless.org/patches/externalpipe-signal/externalpipe_buffer.sh | 15+++++++++------
Msurf.suckless.org/patches/externalpipe-signal/externalpipe_buffer.sh | 15+++++++++------
2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/st.suckless.org/patches/externalpipe-signal/externalpipe_buffer.sh b/st.suckless.org/patches/externalpipe-signal/externalpipe_buffer.sh @@ -5,14 +5,17 @@ # Script enabling keyboard-based dmenu copy/paste between multiple different # st/surf instances. Designed to be used in combination with the surf & st # externalpipe-signal patches. - +# +# Note: by default assumes you've patched both st & surf for SIGUSR1 with +# signal patches and shares 1 buffer for convience. Comment if using just st or surf. +# # Upon executing dmenu_copy/dmenu_type, SIGUSR1 is sent to st & surf. # St/surf then additionally call this script w/ "{surf,st}_strings_read" arg. # This loads up the $BUFFER_FILE (FIFO or file) with the contents filtered # for what should appear in dmenu. If using (BUFFER_FILE_FIFO=true), dmenu # is then immediatedly invoked reading from $BUFFER_FILE as STDIN; if not # using a FIFO, BUFFER_FILE_R_DELAY is waited on before reading file / invoking dmenu. - +# # Highly reccomended for quick feedback: set BUFFER_FILE_FIFO=true & use dmenu # non_blocking_stdin patch: tools.suckless.org/dmenu/patches/non_blocking_stdin/ # @@ -52,10 +55,10 @@ function trigger_sigusr1_and_read_buffer() { cat $BUFFER_FILE rm $BUFFER_FILE } -function dm() { dmenu "$@" -l 10 -i -w $(xdotool getactivewindow) | sed 's/↵/\r/g'; } +function dm() { dmenu "$@" -l 10 -i -w $(xdotool getactivewindow); } function st_strings_read() { - INPUT=$(cat) + INPUT="$(cat)" echo "$( # General Strings, quoted string, and whole lines echo "$INPUT" | grep -Eo '\S+' | tr -d '[:blank:]' @@ -76,7 +79,7 @@ function surf_strings_read() { dedupe_and_sort | write_to_buffer } -function dmenu_copy() { trigger_sigusr1_and_read_buffer | dm -p 'Screen Copy' | xclip -i; } -function dmenu_type() { trigger_sigusr1_and_read_buffer | dm -p 'Screen Type' | xargs xdotool type --delay 0; } +function dmenu_copy() { trigger_sigusr1_and_read_buffer | dm -p 'Screen Copy' | sed 's/↵/\n/g' | xclip -i; } +function dmenu_type() { trigger_sigusr1_and_read_buffer | dm -p 'Screen Type' | sed 's/↵/\n/g' | xargs -IC xdotool type --delay 0 "C"; } $1 diff --git a/surf.suckless.org/patches/externalpipe-signal/externalpipe_buffer.sh b/surf.suckless.org/patches/externalpipe-signal/externalpipe_buffer.sh @@ -5,14 +5,17 @@ # Script enabling keyboard-based dmenu copy/paste between multiple different # st/surf instances. Designed to be used in combination with the surf & st # externalpipe-signal patches. - +# +# Note: by default assumes you've patched both st & surf for SIGUSR1 with +# signal patches and shares 1 buffer for convience. Comment if using just st or surf. +# # Upon executing dmenu_copy/dmenu_type, SIGUSR1 is sent to st & surf. # St/surf then additionally call this script w/ "{surf,st}_strings_read" arg. # This loads up the $BUFFER_FILE (FIFO or file) with the contents filtered # for what should appear in dmenu. If using (BUFFER_FILE_FIFO=true), dmenu # is then immediatedly invoked reading from $BUFFER_FILE as STDIN; if not # using a FIFO, BUFFER_FILE_R_DELAY is waited on before reading file / invoking dmenu. - +# # Highly reccomended for quick feedback: set BUFFER_FILE_FIFO=true & use dmenu # non_blocking_stdin patch: tools.suckless.org/dmenu/patches/non_blocking_stdin/ # @@ -52,10 +55,10 @@ function trigger_sigusr1_and_read_buffer() { cat $BUFFER_FILE rm $BUFFER_FILE } -function dm() { dmenu "$@" -l 10 -i -w $(xdotool getactivewindow) | sed 's/↵/\r/g'; } +function dm() { dmenu "$@" -l 10 -i -w $(xdotool getactivewindow); } function st_strings_read() { - INPUT=$(cat) + INPUT="$(cat)" echo "$( # General Strings, quoted string, and whole lines echo "$INPUT" | grep -Eo '\S+' | tr -d '[:blank:]' @@ -76,7 +79,7 @@ function surf_strings_read() { dedupe_and_sort | write_to_buffer } -function dmenu_copy() { trigger_sigusr1_and_read_buffer | dm -p 'Screen Copy' | xclip -i; } -function dmenu_type() { trigger_sigusr1_and_read_buffer | dm -p 'Screen Type' | xargs xdotool type --delay 0; } +function dmenu_copy() { trigger_sigusr1_and_read_buffer | dm -p 'Screen Copy' | sed 's/↵/\n/g' | xclip -i; } +function dmenu_type() { trigger_sigusr1_and_read_buffer | dm -p 'Screen Type' | sed 's/↵/\n/g' | xargs -IC xdotool type --delay 0 "C"; } $1