[Tkabber] tkabber_setstatus script

Arkadiusz Podgórski wodzu at sail-ho.pl
Sun Jan 18 22:58:53 MSK 2004


On Sun, Dec 21, 2003 at 09:12:38PM +0100, Frank Niedermann wrote:
> with the help of aleksey I have adjusted the tkabber_setstatus script.
> Now it can change the presence-text and the presence-status
> (available, away, xa, ...). I've also included some descriptions and
> examples:

Hi. I've just used your script. Nice but if we want to change status
text, we have to set $userstatus too. So we have to write ,,tkstat
<any-status> "some interesting info"''... In such way xmms awakes tkaber
if user is away. It's not desirable. So I've changed your script - now
it accepts special empty state name - " ". In such case it does not
change status 'cos sets it to previosu state (yes, it forces tkabber to
send status info).

I'm not tcl guru, so I've written it in way it works, not most effective
way -  now ,,if'' is executed once per every tkabber instance. It's not
important, but not elegant.

> #!/usr/bin/wish
[cut - nothing changed]
> # change status for every tkabber process
> foreach i $tkabbers {
    if { [lindex $argv 0] == " "  } { 
        catch { send -async $i "set textstatus \"[lindex $argv 1]\"
              set userstatus \$userstatus" }
    } {
        catch { send -async $i "set textstatus \"[lindex $argv 1]\"
              set userstatus [lindex $argv 0]" }
    }
> }
> exit

In this way it's safe to set xmms ,,song change plugin'' command:
  tkset " " "%s"
It changes status info, but not status, so away is working correctly.

Regards, Arek.

-- 
# *sig. under construction* #%#--#####+####+#######x############++=##
nie moge dojsc, jak oni uzywaja wielkich liter. 
moze maja inny typ klawiatury?
#"##%%###%%#####+##=###%### _wodzu at sail-ho.pl_ ####%####**###||######


More information about the Tkabber mailing list