[dev] [wmii] highlight tag script

From: fffff <spambox_AT_hshhhhh.name>
Date: Wed, 24 Mar 2010 15:46:29 +0000

Hi. A linux dc-client named 'linuxdcpp' when somebody write something in
chat can highlight tag where he running, he renamed tag from 'linuxdcpp' to
'*linuxdcpp'.
I thought it a good idea if my icq or irc clients may highlights tags too
and i've written a little and ugly bash script:

#!/bin/bash
> # Highlight script for wmii; author hshhhhh; e-mail: spambox_AT_hshhhhh.name
> # Usage: wmii_highlight tagname
>
> HIGHLIGHT_PREFIX='* '
> HIGHLIGHT_POSTFIX=''
>
> if [ $# -ne 1 ]; then
> exit
> fi

IS_TAG_EXISTS=0
> for i in $( wmiir ls /lbar/ ); do
> if [ "$1" = "$i" ]; then
> IS_TAG_EXISTS=1
> fi
> done
>
> if [ $IS_TAG_EXISTS -ne 1 ]; then
> exit
> fi
>
> if [ "$1" = "$(wmiir read /tag/sel/ctl | head -n 1)" ]; then
> exit
> else
> `wmiir xwrite /lbar/$1 "$HIGHLIGHT_PREFIX""$1""$HIGHLIGHT_POSTFIX"`
> fi
> exit
>
Received on Wed Mar 24 2010 - 15:46:29 UTC

This archive was generated by hypermail 2.2.0 : Wed Mar 24 2010 - 16:00:03 UTC