nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 87 lines 2.3 kB view raw
1diff --git a/util/stumpish/stumpish b/util/stumpish/stumpish 2index 830cb1b..64213dc 100755 3--- a/util/stumpish/stumpish 4+++ b/util/stumpish/stumpish 5@@ -28,8 +28,8 @@ then 6 fi 7 8 # replace -E with -r option for old versions of GNU sed 9-if ! sed -E 1p /dev/null 2>/dev/null; then 10- sed() { shift; command sed -r "$@"; } 11+if ! @sed@ -E 1p /dev/null 2>/dev/null; then 12+ sed() { shift; command @sed@ -r "$@"; } 13 fi 14 15 # parse C-style backslash sequences by default 16@@ -41,9 +41,9 @@ wait_result () 17 { 18 while true 19 do 20- RESULT=$(xprop -root -f STUMPWM_COMMAND_RESULT 8s \ 21+ RESULT=$(@xprop@ -root -f STUMPWM_COMMAND_RESULT 8s \ 22 STUMPWM_COMMAND_RESULT 2>/dev/null | 23- sed -E 's/\\([[:digit:]]+)/\\0\1/g') 24+ @sed@ -E 's/\\([[:digit:]]+)/\\0\1/g') 25 if echo "$RESULT" | grep -v -q 'not found.$' 26 then 27 break 28@@ -52,7 +52,7 @@ wait_result () 29 sleep $DELAY 30 done 31 32- xprop -root -remove STUMPWM_COMMAND_RESULT 33+ @xprop@ -root -remove STUMPWM_COMMAND_RESULT 34 35 if echo "$RESULT" | grep -q '= $' 36 then 37@@ -60,7 +60,7 @@ wait_result () 38 fi 39 40 echo "$RESULT" | 41- sed -E 's/[^"\\n]+"// 42+ @sed@ -E 's/[^"\\n]+"// 43 /^"[[:space:]]*$/d 44 s/(^|[^\\])\\n/\1\ 45 /g 46@@ -80,7 +80,7 @@ send_cmd () 47 exit 48 fi 49 50- xprop -root -f STUMPWM_COMMAND 8s -set STUMPWM_COMMAND "$cmd" 51+ @xprop@ -root -f STUMPWM_COMMAND 8s -set STUMPWM_COMMAND "$cmd" 52 53 wait_result 54 } 55@@ -123,8 +123,8 @@ tput () 56 local cap1=$1 cap2=$2 57 shift 2 58 59- command tput $cap1 $@ 2>/dev/null || 60- command tput $cap2 $@ 2>/dev/null 61+ command @tput@ $cap1 $@ 2>/dev/null || 62+ command @tput@ $cap2 $@ 2>/dev/null 63 } 64 65 READLINE=yes 66@@ -156,18 +156,18 @@ then 67 else 68 if [ -t 0 ] 69 then 70- if ! type rlwrap 2>/dev/null >&2 71+ if ! type @rlwrap@ 2>/dev/null >&2 72 then 73 warn rlwrap not found, command completion won\'t work 74 elif [ $READLINE = yes ] 75 then 76 COMMANDS="${TMPDIR:-/tmp}/stumpish.commands.$$" 77 echo $(send_cmd "commands") | 78- sed -E 's/[[:space:]]+/\ 79+ @sed@ -E 's/[[:space:]]+/\ 80 /g' | 81 sort > "$COMMANDS" 82 trap 'rm -f "$COMMANDS"' exit int term 83- rlwrap -b '' -f "$COMMANDS" "$0" -r 84+ @rlwrap@ -b '' -f "$COMMANDS" "$0" -r 85 exit 86 fi 87