linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / tools / misc / minicom / xminicom_terminal_paths.patch
blob18535253d9f54cfc83b20614053575abcd171cc5
1 diff --git a/src/xminicom b/src/xminicom
2 index a59aa08..cef153b 100755
3 --- a/src/xminicom
4 +++ b/src/xminicom
5 @@ -7,57 +7,39 @@
7 # version $Id: xminicom,v 1.4 2008-06-09 20:48:35 al-guest Exp $
9 -findcmd()
11 - IFS=:
12 - for i in $PATH
13 - do
14 - if [ -x $i\/$1 ]
15 - then
16 - result=$i\/$1
17 - IFS=
18 - return 0
19 - fi
20 - done
21 - result=
22 - IFS=
23 - return 1
24 +findcmd() {
25 + result=$(command -v $1)
28 -if findcmd x-terminal-emulator
29 -then
30 +if findcmd x-terminal-emulator ; then
31 exec $result -T minicom -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
32 exit 1
35 -if findcmd color_xterm
36 -then
37 +if findcmd konsole ; then
38 + exec $result -T minicom -geometry 80x25 -e minicom -m -c on "$@"
39 + exit 1
40 +fi
42 +if findcmd gnome-terminal ; then
43 + exec $result -T minicom -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
44 + exit 1
45 +fi
47 +if findcmd color_xterm ; then
48 exec $result -T minicom -bg black -fg grey -n minicom -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
49 exit 1
52 -if findcmd rxvt
53 -then
54 +if findcmd rxvt ; then
55 exec $result -bg black -fg grey -n minicom -T minicom -sl 0 -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
56 exit 1
59 -if findcmd kterm
60 -then
61 +if findcmd xterm ; then
62 exec $result -T minicom -n minicom -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
63 exit 1
66 -if findcmd xterm
67 -then
68 - if [ -f /etc/debian_version ]
69 - then
70 - exec $result -T minicom -n minicom -bg black -fg grey -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
71 - else
72 - exec $result -T minicom -n minicom -geometry 80x25 -e "if ! minicom -m -c on $*; then echo Press ENTER to continue...; read; fi"
73 - fi
74 - exit 1
75 -fi
77 -echo "xminicom: rxvt, color_xterm or xterm NOT found!" 1>&2
78 +echo "xminicom: konsole, gnome-terminal, rxvt, color_xterm or xterm NOT found!" 1>&2
79 exit 1