
Kopete Away Message Updater
Source (link to git-repo or to original if based on someone elses unmodified work):
Available as/for:
Description:- a comment (starting with a #)
- flags message
The flags define some properties to each away message. Flags are defined
only at the start of the line, beginning and ending with a %. The following
flags are supported.
[0-9]*[smhd] Determines how long this message should be shown before a
new one is chosen. This is the sleep(1) syntax.
a Only show this message when you're away.
c This line is a command, use it's output as away message.
f Fortune mode. Picks a random line from a file and displays it.
i Show the contents of a file, line by line. The message should
contain the path to the file. Do not use ~ but use /home/$USER instead.
Empty lines in the included file are skipped.
n Use the next message in the file for the next iteration.
o Only show this message when you're online.
x Don't use this message when looking for a random message. This
means this line is only accessible when the former line contains
the n flag.
- Show the message less than normal times
-- Show the message even more less
--- Show the message sometimes
Example ~/.kopete-away-msgs file:
========================================================================
# Sometimes, show uptime for one minute
%1mc--% uptime
# Fortune rocks, but don't pick too long messages (the length of away
# messages is limited).
%2mc% fortune -s -n 120
# just show Hello world for the default interval
Hello world
# Show a away message for 60 seconds.
%a60% I'm away now.
# Ask people to say something when you're online
%o% Please message me!
# Show all contents of the Linux README line by line. Show each line for
# 3 seconds.
%3i% /usr/src/linux/README
# Tell a little story when I'm away. These lines must emerge in the
# right order, so mind the n and x flags! The x flags make sure we don't
# start in the middle of the story. And, show each line for about 5
# seconds.
%na5% Goodbye, all you people,
%nax5% There's nothing you can say
%nax5% To make me change my mind.
%ax5% Goodbye.
========================================================================
There are two ways of determining your online status:
1) Patched Kopete (direct status check)
Apply the patch in KDE Bug 117962
(http://bugs.kde.org/attachment.cgi?id=18979&action=view) to the Kopete source
in the KDE 3.5 branch. This will add DCOP calls used by this script to
directly query your online status.
2) Webstatus Plugin (indirect status check)
To determine your online status, you need to have the Web Presence plugin
enabled. By default, it reads the file ~/.webstatus.xml. Adapt the variable
below if you store the file somewhere else. The script won't do anything when
you're offline or partially away (that is, some protocols are Away, some
protocols are Online).
Because the web status plugin is used, the process of retrieving the current
webstatus is not really reliable. It may happen that you turn back to online
when you set the status on Away in a short time. If this doesn't happen in
about 10 seconds after the status change, you may consider the status change
as successful.
o Ability to query the online/away status directly from Kopete (DCOP). This requires a patched Kopete, see the description for more details on how to proceed.
o Fortune mode: Pick a random line from a given text file.
o First check the online/away status to prevent unnecessary command calls.
o Various bugfixes
Ratings & Comments
0 Comments