--- trunk/dwm-popup 2007/07/28 20:00:07 43 +++ trunk/dwm-popup 2007/07/28 23:49:51 44 @@ -1,14 +1,31 @@ -#!/bin/sh -x +#!/bin/sh -name="dwm-popup" -term="rxvt -geometry 100x30+100-0 -name $name -fn neep-alt-iso8859-2-24 -rv +sb -n $name -ls -e dwm-popup-term" +uid="$1" +test -z "$uid" && uid="null" +name="dwm-popup-$uid" +id_f="/tmp/$name.id" -if [ ! -e /tmp/popup.id ] ; then +if [ "$2" == "term" ] ; then + id=`xwit -current -print | cut -d: -f1` + echo "*** uid $uid id $id ***" + echo $id > $id_f + + case $uid in + a) exec screen -R -S $name ;; + s) exec screen -R -S $name irssi ;; + *) echo "*** default fallback for $uid ***" ; exec bash ;; + esac +fi + +# +term="rxvt -geometry 100x43+100-20 -name $name -fn neep-alt-iso8859-2-24 -rv +sb -n $name -ls -e $0 $uid term" + +if [ ! -e $id_f ] ; then $term else - id=`cat /tmp/popup.id` + id=`cat $id_f` info=`xwininfo -id $id` - echo "*** $id ***" + echo "*** $id from $id_f ***" test ! -z "$info" && ( op="-unmap" echo $info | grep 'Map State: IsViewable' > /dev/null || op="-pop"