[Tkabber-dev] r524 - trunk/plugins/green

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Thu Aug 23 17:33:45 MSK 2012


Author: sergei
Date: 2012-08-23 17:33:45 +0400 (Thu, 23 Aug 2012)
New Revision: 524

Modified:
   trunk/plugins/green/INSTALL
   trunk/plugins/green/README
   trunk/plugins/green/green.tcl
Log:
  * green.tcl: Do not reconnect to a connection if it's already connecting.
  * README, INSTALL: Added a few words about dbus-tcl.


Modified: trunk/plugins/green/INSTALL
===================================================================
--- trunk/plugins/green/INSTALL	2012-08-23 09:30:52 UTC (rev 523)
+++ trunk/plugins/green/INSTALL	2012-08-23 13:33:45 UTC (rev 524)
@@ -2,6 +2,10 @@
 "winpm" Tcl extension which can be found at
 http://tkwinpm.googlecode.com.
 
+To use this plugin in conjunction with DBus based notification
+system one has to install the dbus-tcl Tcl extension which is
+available at http://sourceforge.net/projects/dbus-tcl/.
+
 To install the plugin, as usually, copy this directory
 under the Tkabber's plugins directory (which is
 "~/.tkabber/plugins" on Unix,
@@ -17,6 +21,6 @@
 Consult the README file for the details about using this plugin.
 
 On Windows it will just work provided "winpm" Tcl extension is
-available for Tkabber; on X Window-based systems additional
-setup is required -- please consult the README file for details.
-
+available for Tkabber; on X Window-based systems without DBus
+additional setup is required -- please consult the README file
+for details.

Modified: trunk/plugins/green/README
===================================================================
--- trunk/plugins/green/README	2012-08-23 09:30:52 UTC (rev 523)
+++ trunk/plugins/green/README	2012-08-23 13:33:45 UTC (rev 524)
@@ -20,7 +20,8 @@
 facilities the underlying OS provides. Currently this plugin
 supports Windows 2000 and above through the usage of external
 Tcl/Tk extension and X Window-based systems (namely, Linux)
-through the usage of special "activator script".
+through the usage of DBus based notifications or a special
+"activator script".
 
 In any case, this plugin should be installed as any other
 Tkabber plugin first.
@@ -61,9 +62,23 @@
 
 Since X Window doesn have any notion of power broadcasts, each
 X-based system uses its own way of delivering the information
-about power state changes to the running applications. Usually
-this is done via some specific shell scripts.
+about power state changes to the running applications. It can be
+done either via DBus notification mechanism, which is used by
+many desktop environments (GNOME, KDE, XFCE etc.), or via some
+specific shell scripts.
 
+II.2.1 DBus notifications
+
+If the dbus-tcl Tcl extension is available then this plugin
+installs callbacks on two DBus signals:
+org.freedesktop.UPower.Sleeping and
+org.freedesktop.UPower.Resuming. If the system uses these
+notification signals then the user isn't required to
+do any additional setup, and the plugin will be fully
+functional.
+
+II.2.2 Shell scripts
+
 To handle this kind of setup this plugin provides one special
 "activator script" which uses the ability of Tcl/Tk programs
 running on the same X display to communicate by sending Tcl

Modified: trunk/plugins/green/green.tcl
===================================================================
--- trunk/plugins/green/green.tcl	2012-08-23 09:30:52 UTC (rev 523)
+++ trunk/plugins/green/green.tcl	2012-08-23 13:33:45 UTC (rev 524)
@@ -88,6 +88,7 @@
 }
 
 proc green::xlib_connected {xlib} {
-	expr {[lsearch -exact [connections] $xlib] >= 0}
+	# return 1 if $xlib is already connected or is connecting currently
+	expr {[lsearch -exact [connections 1] $xlib] >= 0}
 }
 



More information about the Tkabber-dev mailing list