Tclkeymon, Error on line 746

Help
orastreet
2004-03-26
2004-03-30
  • orastreet

    orastreet - 2004-03-26

    Thanks for a great program. I had it running in
    Fedora, but have switched to Xandros 2.0. You are
    probably aware that it's Debian based, and I can't seem
    to get the program to start.

    I have installed the tclkeymon executable to
    /usr/local/bin. When I run the program, I get this error

    Error in startup script: invalid command name "wm"
    while executing
    "wm withdraw ."
    (file "/usr/local/bin/tclkeymon" line 746)

    I looked around and saw that some people had an xhost
    +localhost issue, however in Xandros, that already have
    a similar line in your .bash_profile:

    /usr/bin/X11/xhost +localhost &>/dev/null

    I assume this entry in my .bash_profile is perhaps a
    different way of accomplishing the same thing. I wasn't sure, so I ran xhost +localhost the command line and I get:

    tim@uzzi:~$ xhost +localhost
    localhost being added to access control list
    tim@uzzi:~$ su -
    uzzi:~# tclkeymon &
    [1] 2620
    uzzi:~# Application initialization failed: no display
    name and no $DISPLAY environment variable

    Thu Mar 25 21:01:42 CST 2004

    Setting: t_button=/usr/bin/gnome-terminal
    Setting: cd_dvd=/dev/hdc
    Setting: keyFile=/proc/acpi/toshiba/keys
    Setting: lcdFile=/proc/acpi/toshiba/lcd
    Initializing brightness to medium intensity
    Setting: videoFile=/proc/acpi/toshiba/video
    Setting: lidHello=Hello
    Setting: lidGoodbye=Goodbye
    Setting: lidFile=/proc/acpi/button/lid/LID/state
    Setting: fanFile=/proc/acpi/toshiba/fan
    Setting: fanState=low
    Initializing fan on, low
    Setting: pollInterval=500
    Error in startup script: invalid command name "wm"
    while executing
    "wm withdraw ."
    (file "/usr/local/bin/tclkeymon" line 746)

    Please help, this Toshiba is a little dim without this
    program! It's a life saver.

     
    • Anonymous - 2004-03-26

      The key is this part of the error message:

      "Application initialization failed: no display
      name and no $DISPLAY environment variable"

      It appears that the distribution you are using is not initializing this variable.  Before running tclkeymon, execute this command:

      export DISPLAY=localhost:0.0

      (or the equivalent for the shell you are using; the above will work in bash).

      This variable tells all X windows programs where the console is; remember that with X the display can be on a remote (network connected) machine.  The normal default value, localhost:0.0, indicates that the display is on the same machine as the running software, at the first display device (i.e., the monitor/keyboard/mouse connected to your machine).

      Most distributions will set this default for you.  Debian-based distributions tend to be oriented toward more technically knowledgable users.  You may want to consider a more end-user oriented distribution, like Mandrake, SuSE or Fedora Core.  Then again, learning this stuff is half the fun.  :-)

       
    • orastreet

      orastreet - 2004-03-27

      Mace,

      Thanks for your suggestion.  Hey, I thought Xandros was supposed to be easy!  Actually, I'm fairly versed in running Linux servers, but am still getting up to speed on the desktops.  Your program has been an absolute lifesaver.

      For the record I had tclkeymon running on Fedora, but Fedora was so bad and buggy I couldn't use it for my production laptop.  I needed something I didn't have to mess with ...so much for that, and of course I have experience with mostly Red Hat and Suse and this is my first adventure using Debian. 

      I ran the command you suggested, and now have a different error.  I apologize if this is a dumb error.  Thanks for your help.

      uzzi:~# export DISPLAY=localhost:0.0
      uzzi:~# tclkeymon &
      [1] 2497
      uzzi:~# Application initialization failed: this isn't a Tk applicationcouldn't connect to display "localhost:0.0"

      Fri Mar 26 20:48:52 CST 2004

      Setting: t_button=/usr/bin/gnome-terminal
      Setting: cd_dvd=/dev/hdc
      Setting: keyFile=/proc/acpi/toshiba/keys
      Setting: lcdFile=/proc/acpi/toshiba/lcd
      Initializing brightness to medium intensity
      Setting: videoFile=/proc/acpi/toshiba/video
      Setting: lidHello=Hello
      Setting: lidGoodbye=Goodbye
      Setting: lidFile=/proc/acpi/button/lid/LID/state
      Setting: fanFile=/proc/acpi/toshiba/fan
      Setting: fanState=low
      Initializing fan on, low
      Setting: pollInterval=500
      Error in startup script: invalid command name "wm"
          while executing
      "wm withdraw ."
          (file "/usr/local/bin/tclkeymon" line 746)

       
      • Anonymous - 2004-03-27

        Did you remember to issue the xhost command to authorize access to the display (check the README)?

        /usr/bin/X11/xhost +localhost

        Essentially, if you can start an xterm from the same environment (or any X application), you can start tclkeymon.

        There was a bug in a very old version of TK, but I can't imagine that you are using software that old (even if you are based on debian stable).   It's more likely, the the requirements for starting any X application have not yet been met, at the point you are trying to start the program.

         
    • orastreet

      orastreet - 2004-03-27

      Mace,

      Thanks for your suggestion.  Hey, I thought Xandros was supposed to be easy!  Actually, I'm fairly versed in running Linux servers, but am still getting up to speed on the desktops.  Your program has been an absolute lifesaver.

      For the record I had tclkeymon running on Fedora, but Fedora was so bad and buggy I couldn't use it for my production laptop.  I needed something I didn't have to mess with ...so much for that, and of course I have experience with mostly Red Hat and Suse and this is my first adventure using Debian. 

      I ran the command you suggested, and now have a different error.  I apologize if this is a dumb error.  Thanks for your help.

      uzzi:~# export DISPLAY=localhost:0.0
      uzzi:~# tclkeymon &
      [1] 2497
      uzzi:~# Application initialization failed: this isn't a Tk applicationcouldn't connect to display "localhost:0.0"

      Fri Mar 26 20:48:52 CST 2004

      Setting: t_button=/usr/bin/gnome-terminal
      Setting: cd_dvd=/dev/hdc
      Setting: keyFile=/proc/acpi/toshiba/keys
      Setting: lcdFile=/proc/acpi/toshiba/lcd
      Initializing brightness to medium intensity
      Setting: videoFile=/proc/acpi/toshiba/video
      Setting: lidHello=Hello
      Setting: lidGoodbye=Goodbye
      Setting: lidFile=/proc/acpi/button/lid/LID/state
      Setting: fanFile=/proc/acpi/toshiba/fan
      Setting: fanState=low
      Initializing fan on, low
      Setting: pollInterval=500
      Error in startup script: invalid command name "wm"
          while executing
      "wm withdraw ."
          (file "/usr/local/bin/tclkeymon" line 746)

       
    • Anonymous - 2004-03-27

      I just thought of another possible cause, since your distribution is Debian-based.  In your log above, you used 'su'; on a Debian system you may need to use 'sux'.  See:

      http://packages.debian.org/unstable/admin/sux

       
    • orastreet

      orastreet - 2004-03-27

      Mace,

      Do you have any other suggestions or are there some other files I can post to maybe point to the problem? 

      I really appreciate all your help.

       
      • Anonymous - 2004-03-28

        Well, try issuing the command 'xterm'.  Does it open a window?  If not, then you can't run any X Window applications (including tclkeymon).  You'll need to resolve that issue first.

        If xterm opens OK, but tclkeymon still says it can't connect to the display, try running tclkeymon from the just opened xterm.  If that works, there's some funky X authorization problem.  If you have PAM installed, you may need to change the configuration, or copy the ~/.Xauthority file from the logged in user to get around the permission restriction. 

        What version of TCL, TK and Expect are installed?  Development and testing are performed on:

        tcl-8.3.5
        tk-8.3.5
        expect-5.39

        If you have older versions, you can try upgrading them.

        Nothing else comes to mind.  Let me know how it goes.

         
    • orastreet

      orastreet - 2004-03-28

      You are the champ.  I'm running:

      expect - 5.38.0-5

      tcl 8.4
      tk 8.4

      Xandros has a cool way of managing all your programs, but they want you to stick to the packages they provide, I guess to help things run correctly. 

      I can open an Xterm just fine.  When I run tclkeymon from the xterm I get the same error,

      uzzi:~# /home/tim/My\ Documents/tclkeymon-0.41/tclkeymon &
      [1] 2632
      uzzi:~# Application initialization failed: no display name and no $DISPLAY environment variable

      What I've done is explained the problem to Xandros in a support email to find out what they've done with my xhost and display variable. 

      If I can't get this program running, this state of the art laptop is not very useful running Linux.  And again,  I appreciate your patience.  I see that you are accpeting donations for the project.  I intend to make a personal donation for all your time and effort.  Perhaps through this we can both figure out what is going on.  I doubt I'm the only Xandros user running on a toshiba laptop. 

      One thing that might be of interest.  In goofing around, I commented out line 746, where I was getting the error.  When I do that it lets me use a function key like Fn F7 one time then crashes.  Of course that' s better than nothin, but I thought that might lead be some sort of clue.  Of course the little cool window doesn't pop up, just the screen changes brighter, but after I get the output of the remainder of the tclkeymon executable.   I restart it, it brings the screen dim again.

      Thanks again,

      Tim

       
      • Anonymous - 2004-03-28

        OK, then take it to the next logical step...  In the xterm window, type:

        echo $DISPLAY

        If you get nothing, then your DISPLAY variable has gone unset again.  Reset it (in the xterm window, type: export DISPLAY=localhost:0.0), and try tclkeymon in the xterm window again.

        Also, make sure localhost is defined in your /etc/hosts file; if it's not, many network applications will have a problem (not just X).  You should have an entry like:

        127.0.0.1       localhost.localdomain           localhost

        The line you are commenting out in tclkeymon initializes the X window, so it doesn't really provide any useful information on why X isn't working normally on that machine.  Remember to put it back before continuing your testing.

         
    • orastreet

      orastreet - 2004-03-28

      Well,

      I open up Xterm, reset the display variable (it did lose it in xterm), I verified that the /etc/hosts file had the proper entry in it 127.0.0.1 localhost.localdomain localhost,

      I copied a new fresh tclkeymon executable my home directory where I untarred it, to erase the one I messed with. 

      I notice that I have two files in my home directory.  One is the .bashrc and the other is .bash_profile.  I know different distros use these differently, I don't know if this has anything to do with the problem.  But take a gander at this:

      tim@uzzi:~$ cat .bashrc
      # ~/.bashrc: executed by bash(1) for non-login shells.
      # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
      # for examples

      # If running interactively, then:
      if [ "$PS1" ]; then

          # don't put duplicate lines in the history. See bash(1) for more options
          # export HISTCONTROL=ignoredups

          # check the window size after each command and, if necessary,
          # update the values of LINES and COLUMNS.
          #shopt -s checkwinsize

          # enable color support of ls and also add handy aliases
          if [ "$TERM" != "dumb" ]; then
              eval `dircolors -b`
              alias ls='ls --color=auto'
              #alias dir='ls --color=auto --format=vertical'
              #alias vdir='ls --color=auto --format=long'
          fi

          # some more ls aliases
          #alias ll='ls -l'
          #alias la='ls -A'
          #alias l='ls -CF'

          # set a fancy prompt
          PS1='\u@\h:\w\$ '

          # If this is an xterm set the title to user@host:dir
         # case $TERM in
         # xterm*)
         #     PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
         #     ;;
         # *)
         #     ;;
         # esac

          # enable programmable completion features (you don't need to enable
          # this, if it's already enabled in /etc/bash.bashrc).
          #if [ -f /etc/bash_completion ]; then
          #  . /etc/bash_completion
          #fi

      And here is my .bash_profile

      tim@uzzi:~$ cat .bash_profile
      # ~/.bash_profile: executed by bash(1) for login shells.
      # see /usr/share/doc/bash/examples/startup-files for examples.
      # the files are located in the bash-doc package.

      # the default umask is set in /etc/login.defs
      #umask 022

      # the rest of this file is commented out.

      # include .bashrc if it exists

      #if [ -f ~/.bashrc ]; then
      #    source ~/.bashrc
      #fi

      # set PATH so it includes user's private bin if it exists
      #if [ -d ~/bin ] ; then
      #    PATH=~/bin:"${PATH}"
      #fi

      # do the same with MANPATH
      #if [ -d ~/man ]; then
      #    MANPATH=~/man:"${MANPATH}"
      #    export MANPATH
      #fi
      # --- kcmrscp::start [Do not edit these lines.] ---
      export LANG=en_US
      export LANGUAGE=C
      export LC_ALL=en_US
      export DISPLAY=localhost:0.0
      /usr/bin/X11/xhost +localhost &>/dev/null

      # --- kcmrscp::end ---

      I added the "export Display=localhost:0.0" myself, as it wasn't in there.  I can't believe this is not working.  Xandros must have really tweaked something. 

      Tim

       
    • Anonymous - 2004-03-28

      After you added the DISPLAY variable in the xterm and ran tclkeymon, what messages did you get?

       
    • orastreet

      orastreet - 2004-03-29

      I guess my messages was a little incomplete.

      Steps:
      Openend up xterm by typing tim$xterm
      In the xterm windows I ran;

      xhost +localhost

      I got:

      localhost added to access control list

      then I ran:

      export DISPLAY=localhost:0.0

      no output, but brought me to a new prompt.   Then I ran echo $DISPLAY and got
      locahost:0.0

      I ran su - and became root.

      From root, I typed:

      root#tclkeymon &

      and got my favorite error:

      uzzi:~# Application initialization failed: no display name and no $DISPLAY environment variable

      Mon Mar 29 09:18:49 CST 2004

      Setting: t_button=/usr/bin/gnome-terminal
      Setting: cd_dvd=/dev/hdc
      Setting: keyFile=/proc/acpi/toshiba/keys
      Setting: lcdFile=/proc/acpi/toshiba/lcd
      Initializing brightness to medium intensity
      Setting: videoFile=/proc/acpi/toshiba/video
      Setting: lidHello=Hello
      Setting: lidGoodbye=Goodbye
      Setting: lidFile=/proc/acpi/button/lid/LID/state
      Setting: fanFile=/proc/acpi/toshiba/fan
      Setting: fanState=low
      Initializing fan on, low
      Setting: pollInterval=500
      Error in startup script: invalid command name "wm"
          while executing
      "wm withdraw ."
          (file "/usr/local/bin/tclkeymon" line 746)

      All of which I did from an xterm.

      Perhaps this sheds some light on the problem?

      Tim

       
      • Anonymous - 2004-03-30

        You have the right steps, but in the wrong order.  You need to:

        1. start the xterm
        2. su to root
        3. export DISPLAY
        4. xhost +
        5. run tclkeymon

         
    • orastreet

      orastreet - 2004-03-29

      Mace,

      WOW!  I got it running!  Awesome! 

      I had to install and run the SUX program.   Once I did that, I got it to work. 

      Now, that I can get it to run, how will this effect me starting this automatically? 

      Thanks again for your help.

      Tim

       
      • Anonymous - 2004-03-30

        Then the problem was the Xauthority.  I don't know how Xandros has setup the Xauthority configuration, so I can't be of any help.  I checked, but they don't have a downloadable ISO, so I can't setup the system to check it out.

        Check out the xauth command; it may provide you with the information you need to configure your system.

         
    • orastreet

      orastreet - 2004-03-30

      Thanks so much!  I will figure it out and post my results.  (If I get it figured out) Xandros suggested I use the sudo command if I'm going to be running something as root in my Xsession.  I will try that also. It sucks that I have to use sux, but having a dim screen sux worse if you know what I mean.  Once I run sux, start-tclkeymon works perfect.  thanks again for your help. 

      Tim

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks