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