-
Notifications
You must be signed in to change notification settings - Fork 0
/
uterm
executable file
·56 lines (43 loc) · 857 Bytes
/
uterm
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
#!/bin/sh
DIR="/home/aparicio/scripts"
function exe {
urxvtc $@
if [ $? -eq 2 ]; then
urxvtd -q -o -f
urxvtc $@
fi
}
case $1 in
back)
exe -name term-back -bc -tr -fg white -g 99x57+1+25
exe -name term-back -bc -tr -fg white -g 90x57+605+25
;;
drop)
test -z $2 && echo "Usage: $(basename $0) drop <name>" && exit 1
NAME="urxvtq_$2"
exe -name $NAME -g 120x22 -bd Grey25 -b 1
OK=1
while [ $OK == 1 ]; do
WID=$(xdotool search --name $NAME)
xdotool windowunmap $WID;
OK=$?
done
echo \
"#!/bin/sh
ACTIVE=\$(xdotool getwindowfocus)
xdotool windowfocus $WID
if [ \$? == 1 ]; then
xdotool windowmap $WID
sleep 0.05
xdotool windowfocus $WID
elif [ \$ACTIVE == $WID ]; then
xdotool windowunmap $WID
else
xdotool windowfocus $WID
fi" > $DIR/$NAME
chmod +x $DIR/$NAME
;;
*)
exe -g 130x30 $@;
;;
esac