Hello Ivan F. Villanueva B. on Tue, Dec 04, 2007 at 09:16:32PM CET, you wrote:
> If any of you is using another jabber client and have solved this problem, it
> would be helpful to know how too.

I'm using mcabber, which can call an external script upon jabber
activity. I wrote a script that creates a new rbar with the name of the
jabber contact, and counts the number of messages.
When I reply in mcabber or click the rbar the notification rbar is
removed.

Works great for me. Please find attached the scripts used in a somewhat
/etc/init.d manner. Sadly the scripts are written in sh and not rc,
which would make them more consistent with wmii.

Cheers Alexis.
#!/bin/sh

rstatbar="/rbar/`basename $0`"
statusbar=${rstatbar}
action=$1
button=$2
script=$3

WMII_OFFTEXT='#333333 #000000 #000000'
WMII_NORMTEXT='#666666 #000000 #000000'
WMII_NOTETEXT='#ff9900 #000000 #000000'
WMII_NOTICETEXT='#000000 #ff9900 #000000'
WMII_INFOTEXT='#cccc00 #000000 #000000'
WMII_WARNTEXT='#ff0033 #000000 #000000'
WMII_PANICTEXT='#000000 #cc0000 #000000'

WMII_GREENTEXT='#009900 #000000 #000000'
WMII_BLUETEXT='#336699 #000000 #000000'

                            # blue
WMII_NORMTEXTCOL='#888888'  # '#222222'
WMII_NORMBGCOL='#222222'    # '#5FBF77'
WMII_FOCUSTEXTCOL='#ffffff'
WMII_FOCUSBGCOL='#285577'   # '#153F1F'

DMENU="dmenu -b -fn $WMII_FONT -nb $WMII_NORMBGCOL -nf $WMII_NORMTEXTCOL -sb 
$WMII_FOCUSBGCOL -sf $WMII_FOCUSTEXTCOL"
WMENU="wmii9menu -font $WMII_FONT -nb $WMII_NORMBGCOL -nf $WMII_NORMTEXTCOL -sb 
$WMII_FOCUSBGCOL -sf $WMII_FOCUSTEXTCOL -br $WMII_NORMTEXTCOL"

stopBar() {
    script="`basename $0`"
    pid=`ps axwww -o pid,command | grep "${script} Start" | grep -v grep |
    sed -e 's/^[        ]*//g' | cut -d' ' -f 1 | grep -v $$`
    [ -n "${pid}" ] && kill -TERM ${pid}

    wmiir remove ${statusbar} 2>/dev/null
}

startBar() {
    echo -n "$WMII_NORMTEXT" | wmiir create ${statusbar}
}

setBar() {
    echo -n "$*" | wmiir write ${statusbar}
}

log() {
    setBar "$WMII_NORMTEXT $*"
}

note() {
    setBar "$WMII_NOTETEXT $*"
}

notice() {
    setBar "$WMII_NOTICETEXT $*"
}

info() {
    setBar "$WMII_INFOTEXT $*"
}

warn() {
    setBar "$WMII_WARNTEXT $*"
}

panic() {
    setBar "$WMII_PANICTEXT $*"
}
#!/bin/sh

# this script is also used as a mcabberevent command

. $HOME/.wmii-3.5/status.d/setup

action=$1
button=$2
script=$3

case "$action" in
    Stop)
    ;;

    Start)
    ;;

    *BarClick)
        case "$button" in
            1) stopBar;;
        esac
    ;;

    MSG)
        #   $events_command MSG IN [EMAIL PROTECTED] [file] (when receiving a 
message)
        #   $events_command MSG OUT [EMAIL PROTECTED]       (when sending a 
message)
        #   $events_command MSG MUC room_id [file]  (when receiving a MUC 
message)
        #   $events_command STATUS X [EMAIL PROTECTED]      (new buddy status 
is X)
        inout=$2
        [EMAIL PROTECTED]
        statusbar="${rstatbar}_${buddy}"
        script=`basename $0`
        case "$inout" in
            IN|MUC)
                wmiir ls ${statusbar} \
                    ||  ( startBar ; ln -sf $HOME/.wmii-3.5/status.d/${script} 
$HOME/.wmii-3.5/status.d/${script}_${buddy})
                imc=`wmiir read ${statusbar} | cut -d ':' -f 2`
                imc=`expr ${imc} + 1 2> /dev/null || echo 1`
                notice "${buddy}:${imc}"
            ;;

            OUT)
                stopBar
            ;;
        esac

    ;;

    STATUS)
    ;;

esac

Reply via email to