
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:
%dcopknewstickerKNewsTicker[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
%dcopknewstickerKNewsTickerupdateNews
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:
%dcopknewstickerKNewsTickerupdateNews
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:
%dcopknewstickerKNewsTickerreparseConfig
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:
%dcopknewstickerKNewsTickersetOfflineModetrue
to enable the offline mode, or type
%dcopknewstickerKNewsTickersetOfflineModefalse
to disable offline mode.
Returns the currently configured news query interval in minutes.
Example:
%dcop30knewstickerKNewsTickerinterval%
Returns the currently configured scrolling speed. The returned scrolling speed is specified in pixels per second.
Example:
%dcop20knewstickerKNewsTickerscrollingSpeed%
Returns the number of pixels the scrolltext gets shifted per mousewheel step.
Example:
%dcop15knewstickerKNewsTickermouseWheelSpeed%
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:
%dcop1knewstickerKNewsTickerscrollingDirection%
Returns either 'true' or 'false', depending on whether KNewsTicker uses custom names for the news sites.
Example:
%dcopfalseknewstickerKNewsTickercustomNames%
Returns either 'true' or 'false', depending on whether KNewsTicker has the endless scrolling option enabled.
Example:
%dcoptrueknewstickerKNewsTickerendlessScrolling%
Returns either 'true' or 'false', depending on whether KNewsTicker currently only scrolls the most recent headlines for each news site.
Example:
%dcopfalseknewstickerKNewsTickerscrollMostRecentOnly%
Returns either 'true' or 'false', depending on whether KNewsTicker is currently in offline mode.
Example:
%dcopfalseknewstickerKNewsTickerofflineMode%
Returns either 'true' or 'false', depending on whether KNewsTicker was told to underline the headline which is currently below the mouse cursor.
Example:
%dcoptrueknewstickerKNewsTickerunderlineHighlighted%
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:
%dcoptrueknewstickerKNewsTickershowIcons%
Returns either 'true' or 'false', depending on whether KNewsTicker has the “slowed scrolling” feature activated.
Example:
%dcopfalseknewstickerKNewsTickerslowedScrolling%
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#804000knewstickerKNewsTickerforegroundColor%
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#0030ffknewstickerKNewsTickerbackgroundColor%
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#000080knewstickerKNewsTickerhighlightedColor%
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:
%dcopFreshmeat GNOME News dot.kde.org Slashdot.orgknewstickerKNewsTickernewsSources%
Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team