Tk_theme: dock in system tray

Here we will see how to install Tk_theme to allow Tkabber docking in the system tray.

  1. Install Tcl/Tk development files

    Tk_theme needs some files from the Tcl/tk development package.

    • using apt

      # apt-get install tcl8.4-dev tk8.4-dev

    • using apt on Debian woody

      # apt-get install tcl8.3-dev tcl8.3-dev

  2. Install Tk_theme

    Download, uncompress and configure the package:

    $ wget http://tkabber.jabber.ru/files/other/Tk_Theme-23.tgz
    $ tar -xzvf Tk_Theme-23.tgz
    $ cd Tk_Theme-23
    $ tclsh configure

    You need to know where Tcl and Tk include directories are located:

    $ whereis tcl tk
    tcl: /usr/lib/tcl8.4 /usr/include/tcl8.4
    tk: /usr/lib/tk8.4 /usr/share/tk8.4

    Now edit Makefile and add to the line that starts 'INCLUDE' the proper commands: -Idirectory -Idirectory. On the example you can make:

    $ vim Makefile
    /INCLUDE
    jba  -I/usr/include/tcl8.4 -I/usr/share/tk8.4

    press the Escape key and type this to write and exit the editor:

    :wq

    Compile the package:

    $ make

    We will have to install it manually (you may want to change the destination directory):

    # mkdir /usr/local/lib/tktheme
    # cp theme.so /usr/local/lib/tktheme
    # cp pkgIndex.tcl /usr/local/lib/tktheme

    Finally we will add the destination directory to $TCLLIBPATH so Tkabber can find it:

    # vim /etc/profile
    Goexport TCLLIBPATH=/usr/local/lib

    Press the Escape key. Finally write the file and quit the editor:

    :wq

    Tell the system to load the file immediately:

    # source /etc/profile

  3. Configure Tkabber

    If Tkabber is able to load the docking sytem tray plugin it will show the corresponding icon (1). If you click on it with the mouse Tkabber will be docked/undocked. If you click with the second mouse button a menu (2) will appear.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Gentoo patch...

The tkTheme that is in gentoo portage names itself slightly diffrent.
To make it work in Gentoo you need to chage one line in {patch_to_your_tkabber}/plugins/unix/dockingtray.tcl:

< if {[catch { package require tkTheme }]} {
---
> if {[catch { package require Tk_Theme }]} {

and it should work... I am thinking about submitting this to bugs.gentoo.org. I'll investigate it further - I just don't know where the fault lies: tkabber, tkTheme ebuild, tkabber ebuild...

Filo

tutorials improvement: more distros

Well, once you have a conclusion, tell me and we'll add the step for Gentoo users on the tutorial, if needed.

You can also tell me the different steps a Gentoo user needs to do on the different tutorials we have on the web (I only have Debian, so it's the only distribution I can document myself).

checkinstall

Hello!

I`d suggest to use http://packages.debian.org/unstable/admin/checkinstall when installing Tarballs (it`s from unstable but will install fine on woody) so they get converted to .debs and you can install it using the package managment.

I did this with tclgpgme and it worked like a breeze :) !

Maybe you want to add this in the writeups?

HTH,

Ciao,

Steve

debianizing

Other possibility is directly to make rpm and debs for those packages that do not have them, and have a repository on this website so people can add it to their source.list.

Unfortunately, I have no knowledge on package creation. If you are interested... I think only three packages are not debianized: Tclgpgme, an updated Tkabber (the one on apt is not up to date, and does not suggest additional packages like gpgme, tclgpgme...), and Tk_theme.

Hello! Maybe the official

Hello!

Maybe the official debian package maintainer could be asked to package those extras?

Ciao,

Steve

Debian maintainer seems busy

The official package maintainer seems busy. Latest version of Tkabber is five weeks old now and he has not updated it yet. He has not replied to an email sent three weeks ago about the subject. I think we cannot count with him for having other packages debianized, even for Tkabber itself.

If someone with knowledge or free time wants to build them, at least for i386 an tcl8.4 here is the guide to deb. Perhaps the Jabber.ru administrator allows us to have a little Debian repository here, or perhaps on Tkabber at JabberStudio.org.

Can not compile TkTheme on Debian

Hi,

I'm using Debian with Tkabber from CVS and I just read this interesting article.

While trying to compile the TkTheme with make I get a lot of error messages:
themeLabel.c:326: error: `ClientData' undeclared (first use in this function)
themeLabel.c:326: error: parse error before "wPtr"
themeLabel.c:328: warning: implicit declaration of function `Tk_CreateEventHandler'
themeLabel.c:329: error: parse error before "wPtr"
themeLabel.c:335: error: `Tcl_Obj' undeclared (first use in this function)
themeLabel.c:335: error: `arObj' undeclared (first use in this function)
themeLabel.c:340: error: parse error before "wPtr"
themeLabel.c: At top level:
themeLabel.c:349: error: parse error before "if"
themeLabel.c:355: error: parse error before '(' token
themeLabel.c:358: warning: type defaults to `int' in declaration of `Tcl_SetResult'
themeLabel.c:358: warning: parameter names (without types) in function declaration
themeLabel.c:358: warning: data definition has no type or storage class
themeLabel.c:360: error: parse error before "return"
themeLabel.c:140: warning: `ThemeLabelTraceWrite' defined but not used

The steps bevore make were all okay, I have tcl and tk 8.4 installed.

Any idea about this issue?

Regards,
Frank (XMPP:fbn@charente.de)

ah by the way it's a Debian/W

ah by the way it's a Debian/Woody installation with some packages from SID/unstable ;)

Tk_theme Makefile

Well, Tk_theme generated makefile not only fails to provide an install procedure, it also fails to detect the correct Tcl and Tk include directories.

I tried again to compile it following my own tutorial and I got a bunch of errors, like you. I've modified the 'edit Makefile' section and now it works for me.

Try again and tell me if now it compiles without errors (it still gives me four warnings), and if it works (i don't have time to reinstall it and check if it works correctly).

cannot compile ?

messages above means that system cannot find proper include dir that is probably that you use tcl 8.4 instead 8.3 try to make modifications of paths in Makefile by hand. i'm sure it will work
:)

System tray problem in Gnome and Fluxbox

Hello,

I just found this interesting article when I was looking how to use the window manager systray api in tcl/tk to iconified instead of minimising application.

I installed tk_theme following your instruction and it worked fine for me.

Then I decided to test if it's working and for this installed tkabber using apt-get on a debian unstable.

I am using gnome here, but I tested it on a fluxbox window manager too.

On your screenshot it apear to be iconified in the window manager's systray.
What I have here is a second windows, present from the starting of the program, and working like your demo.
So tkabber can be minimised, and still I got the little window with the logo (I can minimised it too).

It's not what I want, I would like to have something near the mixer and the windows selector on gnome.

I then remember reading some others news about debian having a 2 month old tkabber package, so I removed my tkabber with apt-get and installed the latest version from cvs thinking it's maybe an already fixed problem.
But with this version, the tkabber application is just minimised, the little-window-icon don't exist anymore !

check the changes in CVS, check tksystray

The files where Tkabber implements system tray iconization for *nix systems is in this directory. Currently there are two methods:

  • using Tk_theme, implemented in dockingtray.tcl
  • using tksystray, implemented in systray.tcl

Maybe there was a change in dockingtray.tcl between 0.9.7 and now that broke it for you. You can take a look at the changes in those months if you have free time and find what is the 'breaking code'.

You can also try the other method, using tksystray. Maybe it works the way you wanted it to work.

Syndicate content