-
Notifications
You must be signed in to change notification settings - Fork 9
/
terminal-run
executable file
·49 lines (37 loc) · 1.32 KB
/
terminal-run
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
#!/bin/bash
#$1 is the command to be run.
#$2 is the title.
#set to 1 to display which terminal is being used
DEBUG=0
if [ -f /usr/bin/lxterminal ];then
lxterminal --title="$2" -e bash -c "$1"
[ $DEBUG == 1 ] && echo lxterminal
elif [ -f /usr/bin/xfce4-terminal ];then
xfce4-terminal --title="$2" -x bash -c "$1"
[ $DEBUG == 1 ] && echo xfce4-terminal
elif [ -f /usr/bin/mate-terminal ];then
#mate-terminal --title="$2" -e "bash -c "\""$1"\"""
mate-terminal --title="$2" -x bash -c "$1"
[ $DEBUG == 1 ] && echo mate-terminal
elif [ -f /usr/bin/xterm ];then
xterm -T "$2" -e bash -c "$1"
[ $DEBUG == 1 ] && echo xterm
elif [ -f /usr/bin/konsole ];then
konsole -p tabtitle="$2" -e bash <(echo "$1")
[ $DEBUG == 1 ] && echo konsole
elif [ -f /usr/bin/terminator ];then
terminator -T "$2" -x bash -c "$1"
[ $DEBUG == 1 ] && echo terminator
elif [ -f /usr/bin/gnome-terminal ];then
gnome-terminal --title "$2" -x bash -c "$1"
[ $DEBUG == 1 ] && echo gnome-terminal
elif [ -f /usr/bin/qterminal ];then
qterminal -e bash <(echo "$1")
[ $DEBUG == 1 ] && echo qterminal
elif [ -f /usr/bin/x-terminal-emulator ];then
$(readlink -f /usr/bin/x-terminal-emulator) -e bash -c "$1"
[ $DEBUG == 1 ] && echo x-terminal-emulator
else
echo "Failed to locate any terminal emulators!!!"
exit 1
fi