1 |
#!/bin/sh -x |
#!/bin/sh -x |
2 |
|
|
3 |
name="wmrxvt-popup" |
uid="$1" |
4 |
term="rxvt -geometry 100x30+100-0 -name $name -fn neep-alt-iso8859-2-24 -rv +sb -n $name -ls -e dwm-popup-term" |
test -z "$uid" && uid="null" |
5 |
|
name="dwm-popup-$uid" |
6 |
|
id_f="/dev/shm/$name.id" |
7 |
|
|
8 |
if [ ! -e /tmp/popup.id ] ; then |
if [ "$2" == "term" ] ; then |
9 |
|
id=`xwit -current -print | cut -d: -f1` |
10 |
|
echo "*** uid $uid id $id to $id_f ***" |
11 |
|
echo $id > $id_f |
12 |
|
|
13 |
|
case $uid in |
14 |
|
a) exec screen -R -S $name ;; |
15 |
|
s) exec screen -R -S $name irssi ;; |
16 |
|
*) echo "*** default fallback for $uid ***" ; exec bash ;; |
17 |
|
esac |
18 |
|
fi |
19 |
|
|
20 |
|
|
21 |
|
case $uid in |
22 |
|
a) g="100x43+100-20"; f="neep-alt-iso8859-2-24" ;; |
23 |
|
*) g="80x25+100+100"; f="neep-alt-iso8859-2-18" ; echo "*** default ***" ;; |
24 |
|
esac |
25 |
|
|
26 |
|
term="xterm -geometry $g -name $name -fn $f -rv +sb -n $name -ls -e $0 $uid term" |
27 |
|
echo "*** using term: $term ***" |
28 |
|
|
29 |
|
if [ ! -e $id_f ] ; then |
30 |
$term |
$term |
31 |
else |
else |
32 |
id=`cat /tmp/popup.id` |
id=`cat $id_f` |
33 |
info=`xwininfo -id $id` |
info=`xwininfo -id $id` |
34 |
echo "*** $id ***" |
echo "*** $id from $id_f = $info ***" |
35 |
test ! -z "$info" && ( |
test ! -z "$info" && ( |
36 |
op="-unmap" |
op="-unmap" |
37 |
echo $info | grep 'Map State: IsViewable' > /dev/null || op="-pop" |
echo $info | grep 'Map State: IsViewable' > /dev/null || op="-pop" |