Table of Contents
KNewsTicker features a currently rather extensive, and steadily growing DCOP interface. This is not only used to communicate with other applications, it makes it possible to control KNewsTicker with a shell script as well. The more the interface is extended, the more useful it will become and the more flexible KNewsTicker will be controllable from a script.
To use these DCOP functions you can either use the dcop commandline program or use the more convenient KDCOP application. Both provide the same functionality so it's actually just a matter of taste which program you prefer. :-)
This chapter assumes that you're using the commandline program dcop. To access KNewsTicker's DCOP functions make sure that KNewsTicker is started and then just enter something like this at the console:
%
dcop
knewsticker
KNewsTicker
[function]
If an error appears that tells you that dcop
couldn't be found or executed, please check whether the file
dcop
exists in
$
and make sure its
permissions are set appropriately.TDEDIR
/bin
In that command line, just replace “[function]” with the appropriate function name, that is, type
%
dcop
knewsticker
KNewsTicker
updateNews
to make KNewsTicker check for new news items and download them if necessary.
In this section, all methods which are accessible via KNewsTicker's DCOP interface are listed.
This function forces KNewsTicker to update the internal list of articles (that is, it queries the list of news sources which has been configured for new news) and downloads them when necessary.
This also works if KNewsTicker is currently in offline mode.
Example:
%
dcop
knewsticker
KNewsTicker
updateNews
The reparseConfig command makes KNewsTicker reload its configuration from the configuration file. This function is used by the configuration dialog to talk to KNewsTicker but you can use it if you modified the configuration file by hand.
The configuration file is saved in
~/.trinity/share/config/knewsticker_appletrc
Example:
%
dcop
knewsticker
KNewsTicker
reparseConfig
You can call this function to define whether KNewsTicker is currently in the offline mode (that is, whether KNewsTicker should query the configured news sites for new news).
Example:
%
dcop
knewsticker
KNewsTicker
setOfflineMode
true
to enable the offline mode, or type
%
dcop
knewsticker
KNewsTicker
setOfflineMode
false
to disable offline mode.
Returns the currently configured news query interval in minutes.
Example:
%
dcop
30knewsticker
KNewsTicker
interval
%
Returns the currently configured scrolling speed. The returned scrolling speed is specified in pixels per second.
Example:
%
dcop
20knewsticker
KNewsTicker
scrollingSpeed
%
Returns the number of pixels the scrolltext gets shifted per mousewheel step.
Example:
%
dcop
15knewsticker
KNewsTicker
mouseWheelSpeed
%
Returns an integer which corresponds to the direction the scrolltext is scrolling in:
1 = To the left
2 = To the right
3 = Upwards
4 = Downwards
5 = Upwards, rotated
6 = Downwards, rotated
Example:
%
dcop
1knewsticker
KNewsTicker
scrollingDirection
%
Returns either 'true' or 'false', depending on whether KNewsTicker uses custom names for the news sites.
Example:
%
dcop
falseknewsticker
KNewsTicker
customNames
%
Returns either 'true' or 'false', depending on whether KNewsTicker has the endless scrolling option enabled.
Example:
%
dcop
trueknewsticker
KNewsTicker
endlessScrolling
%
Returns either 'true' or 'false', depending on whether KNewsTicker currently only scrolls the most recent headlines for each news site.
Example:
%
dcop
falseknewsticker
KNewsTicker
scrollMostRecentOnly
%
Returns either 'true' or 'false', depending on whether KNewsTicker is currently in offline mode.
Example:
%
dcop
falseknewsticker
KNewsTicker
offlineMode
%
Returns either 'true' or 'false', depending on whether KNewsTicker was told to underline the headline which is currently below the mouse cursor.
Example:
%
dcop
trueknewsticker
KNewsTicker
underlineHighlighted
%
Returns either 'true' or 'false', depending on whether KNewsTicker currently shows the icon of the news site each particular headline was published at in front of the headline.
Example:
%
dcop
trueknewsticker
KNewsTicker
showIcons
%
Returns either 'true' or 'false', depending on whether KNewsTicker has the “slowed scrolling” feature activated.
Example:
%
dcop
falseknewsticker
KNewsTicker
slowedScrolling
%
Returns the currently configured foreground color as a string in the format “#rrggbb”, where “rr”, “gg” and “bb” are two-digit hexadecimal values representing the intensity of the red, green and blue components in a scale of 00-ff.
Example:
%
dcop
#804000knewsticker
KNewsTicker
foregroundColor
%
Returns the currently configured background color as a string in the format “#rrggbb”, where “rr”, “gg” and “bb” are two-digit hexadecimal values representing the intensity of the red, green and blue components in a scale of 00-ff.
Example:
%
dcop
#0030ffknewsticker
KNewsTicker
backgroundColor
%
Returns the currently configured highlight color as a string in the format “#rrggbb”, where “rr”, “gg” and “bb” are two-digit hexadecimal values representing the intensity of the red, green and blue components in a scale of 00-ff.
Example:
%
dcop
#000080knewsticker
KNewsTicker
highlightedColor
%
Returns the list of currently registered news sources. Note that this returns all news sources, not just the selected ones. In the output, each news source name will be printed on a line.
Example:
%
dcop
Freshmeat GNOME News dot.kde.org Slashdot.orgknewsticker
KNewsTicker
newsSources
%
Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team