utaction meet gaim-remote

Now that gaim-remote is in build 46 I can shamelessly steal an idea that Darren mentioned to me one lunch time.

Using this short script:

#!/bin/ksh -p
utaction -d "gaim-remote 'setstatus?status=away&message=Away from Sun Ray'" > /dev/null 2>&1 &
utaction -c "gaim-remote 'setstatus?status=available'" > /dev/null 2>&1 &
wait

I have my status in all the IM sessions that I have automatically set when I remove my card from my Sun Ray and reset when I return.


This assumes you have /opt/SUNWut/bin in your path.


Short and sweet.


Tags:

Comments:

What file would you store this script under to have it automatically work? Is there a reverse script required when you return?

Posted by Joel Buckley on August 23, 2006 at 09:37 AM BST #

I run it by hand since it is only applicable when gaim is running. The script never exits when you kill it the actions stop taking effect.

However now you mention it having it do:

pwait $(pgrep -u $LOGNAME -x gaim)

and then kill it's two children would get it to last only when gaim was running.

Posted by Chris Gerhard on August 23, 2006 at 09:53 AM BST #

Thanks Chris for this beauty.

Paul Roberts had something similiar using XEmacs, but I didn't like using xemacs as my chat client.

/opt/sfw/bin/gnuclient -batch -eval "(jabber-send-presence \\"away\\" \\"$1\\" 10)"

As I don't have SunRay at Home (how can I get one?) I commonly have to kill the one running in the office and start a fresh when working from home. Thus I have gaimon:

#!/bin/ksh -p
if ! pgrep -u $LOGNAME -x gaim >/dev/null; then
        gaim&
fi

utaction=$(whence utaction)
if [[ -z ${utaction} ]]; then
    if [[ -x /opt/SUNWut/bin/utaction ]]; then
        utaction="/opt/SUNWut/bin/utaction"
    else
        print -u2 "utaction command not found!"
        exit 1
    fi
fi


${utaction} -d \\
    "gaim-remote 'setstatus?status=away&message=Away from Sun Ray'" \\
    > /dev/null 2>&1 &
a=$!
${utaction} -c "gaim-remote 'setstatus?status=available'" > /dev/null 2>&1 &
b=$!
pwait $(pgrep -u $LOGNAME -x gaim)
kill $a
kill $b

Cheers, Stace

Posted by Stacey Marshall on September 15, 2006 at 02:29 AM BST #

[Trackback] My previous use of gaim-remote and utaction to update my IM status automatically was good but I kept not getting invited to lunch when I came into the office as I forgot to reset the message to be “In the Office” or slightly less irr...

Posted by The dot in ... --- ... on October 17, 2006 at 05:55 AM BST #

Post a Comment:
Comments are closed for this entry.
About

This is the old blog of Chris Gerhard. It has mostly moved to http://chrisgerhard.wordpress.com

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
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
    
       
Today