Hey,
I've thrown together a small script which displays a list of your currently online kopete contacts (KDE4):
#!/bin/bash
# Check that kopete is running
VAR=`dbus-send --print-reply --type=method_call --dest=org.kde.kopete /Kopete org.kde.Kopete.contactsByFilter string:"online" 2>&1`
if [ $? != 0 ]; then
{
echo Kopete is not online...
exit 1
} fi
# Get list of online users (returns their ID numbers)
VAR=`dbus-send --print-reply --type=method_call --dest=org.kde.kopete /Kopete org.kde.Kopete.contactsByFilter string:"online" | grep string | replace '"{' '' | replace '}"' '' | replace string '' `
# Translate each ID number to the actual display name
a=0
for i in $VAR; do
ARR[$a]=$'\n '`dbus-send --print-reply --type=method_call --dest=org.kde.kopete /Kopete org.kde.Kopete.getDisplayName string:$i | grep string | replace 'string "' '• ' | replace '"' '' | replace ' ' ''`
let a++
done
# Print each unique display name
echo "${ARR[*]}" | sort | grep -v '^$' | uniq
The script is not very elegant, but it gets the job done. I guess you can use it to quickly check who is online in a terminal, but I mainly use it in the yasp.scripted Widget (see attachment).
Hope someone finds this useful.
Happy new year
- Jacob.
[attachment deleted by admin]