Start up problem

  • Hello, I tried your program with my laptop Toshiba Satelitte Pro A10 and it seems that it works well. The only problem is that I am not able to run it during the satritmg of computer. If I put your script in /etc/rc.d/rc.locale I have this message
    Xlib: connection to ":0.0" refused by server
    Xlib: No protocol specified

    Application initialization failed: this isn't a Tk applicationcouldn't connect to display ":0.0"

    Mon Dec 08 00:18:42 GMT 2003

    Initializing brightness to medium intensity
    Initializing fan on, low
    Error in startup script: invalid command name "wm"
        while executing
    "wm withdraw ."
        (file "/usr/local/bin/tclkeymon" line 659)
    if I put it in /etc/X11/Xsession I have the same message except the first two line. However I if I ran the program as root akter logging in KDE it works perfectly.
    I have Mandrake 9.2, kernel 2.4.22-21mdk.
    Thank you  MIrek

    • Mace Moneta
      Mace Moneta

      The messages indicate that the script is unable to contact the X server, and that no window manager is available.

      This is normally logged when either:

      1. X isn't running (if you start in text mode)
      2. User is not logged in to the console

      Once you login to the X (XDM, GDM, etc.) console and a window manager starts (KDE or Gnome for example), the script will begin operating normally (within 10 seconds if you are using the "start-tclkeymon" example).

      Make sure that the "rc.locale" in Mandrake is the equivalent to "rc.local" -- it should be the last system initialization routine executed.

      Mace Moneta

    • Thanks a lot. The script was still unable to conctact the X server (if started in rc.local) thus I added in /etc/bashrc new line
      with xhost +localhost and now it works.

      I have also some comments (possible improvements). I love your feature "Hello", "Goodbye" but it could be improved by saying "Hello $USER" etc. The only thing is to find who is sitting at :0 (for example with "who | awk '/:0/ {print $1}' "
      or with "who | grep ':0' | cut -d' ' -f1")
      and say his name or better to look in ~/.tclkeymon/ for the files
      hello.txt and goodbye.txt and to say what is in them. If they don't exists say a default message.

      The second thing is about the locking of screen. Many people use defualt kde screensaver, so they could lock the screen
      using command kdesktop_lock --forcelock. Again the same method, check who is on :0 look in ~/.tclkeymon/lock.txt if he prefers xcreensaver or kdesktop_lock and lock the screen.

      Anyway thank you for good program.


      • Mace Moneta
        Mace Moneta

        Thanks for the suggestions!  I'll try to incorporate them in the next version.