OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 #--------------------------------------------- | 2 #--------------------------------------------- |
3 # xdg-terminal | 3 # xdg-terminal |
4 # | 4 # |
5 # Utility script to open the registered terminal emulator | 5 # Utility script to open the registered terminal emulator |
6 # | 6 # |
7 # Refer to the usage() function below for usage. | 7 # Refer to the usage() function below for usage. |
8 # | 8 # |
| 9 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> |
| 10 # Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org> |
9 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at> | 11 # Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at> |
10 # | 12 # |
11 # LICENSE: | 13 # LICENSE: |
12 # | 14 # |
13 #--------------------------------------------- | 15 #--------------------------------------------- |
14 | 16 |
15 manualpage() | 17 manualpage() |
16 { | 18 { |
17 cat << _MANUALPAGE | 19 cat << _MANUALPAGE |
18 _MANUALPAGE | 20 _MANUALPAGE |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 if [ $? -eq 0 ]; then | 110 if [ $? -eq 0 ]; then |
109 exit_success | 111 exit_success |
110 else | 112 else |
111 exit_failure_operation_failed | 113 exit_failure_operation_failed |
112 fi | 114 fi |
113 else | 115 else |
114 exit_failure_operation_impossible "configured terminal program '$TERM' n
ot found or not executable" | 116 exit_failure_operation_impossible "configured terminal program '$TERM' n
ot found or not executable" |
115 fi | 117 fi |
116 } | 118 } |
117 | 119 |
| 120 terminal_lxde() |
| 121 { |
| 122 if which lxterminal &>/dev/null; then |
| 123 if [ x"$1" == x"" ]; then |
| 124 lxterminal |
| 125 else |
| 126 lxterminal -e "$1" |
| 127 fi |
| 128 else |
| 129 terminal_generic "$1" |
| 130 fi |
| 131 } |
| 132 |
118 #[ x"$1" != x"" ] || exit_failure_syntax | 133 #[ x"$1" != x"" ] || exit_failure_syntax |
119 | 134 |
120 command= | 135 command= |
121 while [ $# -gt 0 ] ; do | 136 while [ $# -gt 0 ] ; do |
122 parm="$1" | 137 parm="$1" |
123 shift | 138 shift |
124 | 139 |
125 case "$parm" in | 140 case "$parm" in |
126 -*) | 141 -*) |
127 exit_failure_syntax "unexpected option '$parm'" | 142 exit_failure_syntax "unexpected option '$parm'" |
(...skipping 24 matching lines...) Expand all Loading... |
152 ;; | 167 ;; |
153 | 168 |
154 gnome) | 169 gnome) |
155 terminal_gnome "$command" | 170 terminal_gnome "$command" |
156 ;; | 171 ;; |
157 | 172 |
158 xfce) | 173 xfce) |
159 terminal_xfce "$command" | 174 terminal_xfce "$command" |
160 ;; | 175 ;; |
161 | 176 |
| 177 lxde) |
| 178 terminal_lxde "$command" |
| 179 ;; |
| 180 |
162 generic) | 181 generic) |
163 terminal_generic "$command" | 182 terminal_generic "$command" |
164 ;; | 183 ;; |
165 | 184 |
166 *) | 185 *) |
167 exit_failure_operation_impossible "no terminal emulator available" | 186 exit_failure_operation_impossible "no terminal emulator available" |
168 ;; | 187 ;; |
169 esac | 188 esac |
OLD | NEW |