1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

xterm window now opens on GIMP start up

Discussion in 'GIMP for Mac' started by leonardo, Mar 20, 2008.

  1. leonardo

    leonardo New Member

    Joined:
    Mar 17, 2008
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    When I open recently installed GIMP 2.4.5 PPC the xterm window opens during GIMP start up and has to be manually closed.

    When I open GIMP 2.4.3 PPC (using the same X11 window manager) the xterm window does not open and never did.

    Any ideas on how to prevent the xterm window from opening with GIMP 2.4.5 PPC?

    Thanks
     
  2. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Yeah I noticed that too, it's probably a difference in the app skeleton. The change was probably introduced when switching to the new build method.

    I already tried to look a bit at it, but these parts are very obscure and undocumented, so so far I haven't been successful. Anyone who has an idea, please share ;)
     
  3. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Hah I think I got it! It would be a Tiger-only problem

    Could you please try the following :

    * open Gimp.app/Contents/Resources/script
    * locate the part where it says "if [ $OSXVER -lt 9 ]; then"
    * right under that line, add the following lines :

    If you can confirm it works, I will commit it to SVN and it will be integrated in next release  ;D
    (warning, copying and pasting from browser might cause incorrect line endings)
     
  4. leonardo

    leonardo New Member

    Joined:
    Mar 17, 2008
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Sorry Auria, I couldn't get it to work for me.

    Smultron opened for the first time and I entered the lines and triple checked them then saved.

    Going into "the belly of the beast" is remarkable! You say this is a "Tiger-only problem." Is this script "inside" X11 or part of the MacPorts "build/package?" I need to get myself more informed.

    Thank you for your swift response and efforts.
     
  5. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    leonardo, what do you mean it did not work? GIMP won't open anymore, nothing changes?

    Did you convert line endings, using menu Text > Line Endings?

    Maybe you need to remove your old X config file? try "rm .Xinitrc" before starting
     
  6. leonardo

    leonardo New Member

    Joined:
    Mar 17, 2008
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Nothing changed that I noticed. The xterm window still opens on start up.

    As for "line endings" I just thought you meant check the ends of the lines to make sure they looked the same!

    I opened Smultron and found the Text > Line Endings menu where the options are Unix - Mac OS X (LF), Mac (CR), Dark Side (CRLF), Unicode (Line), Unicode (Paragraph). Which one do I use? And do I first select the new script text and then do Line Endings? Or should I delete it and start over again?

    As for "Maybe you need to remove your old X config file? try "rm .Xinitrc" before starting" I have no idea what this means.

    Thank you for your patience.
     
  7. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Okay, just select your current script text, then choose the Unix line endings. I think this will make it work :)


    As for the other bit, I just meant that if you can't get it to run despite fixing line endings, also try running command 'rm .Xinitrc' on the terminal then try gimp again. but i don't think that's necessary
     
  8. leonardo

    leonardo New Member

    Joined:
    Mar 17, 2008
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Selected new script text in Smultron.
    Smultron menu > Text > Line Endings > Unix - Mac OS X (LF).
    Hit saved button and existed Smultron.
    Opened GIMP and xterm window still opens on start up.

    When I typed in 'rm .Xinitrc' in the xterm window and hit return "rm: .Xinitrc: No such file or directory" popped up!
     

    Attached Files:

    • lol.jpg
      lol.jpg
      File size:
      293.7 KB
      Views:
      201
  9. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Weird, it works here :/

    Your script file looks like that, right?
    Code:
    ....
    # tiger or before
    if [ $OSXVER -lt 9 ]; then
    
        # modify X11 config file by commenting out 'xterm',
        # so that we're not annoyed by a xterm window on startup
        ps -wx -ocommand | grep -e '[X]11' > /dev/null
        if [ "$?" != "0" -a ! -f ~/.xinitrc ]; then
            echo "rm -f ~/.xinitrc" > ~/.xinitrc
            sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> ~/.xinitrc
        fi
    
        # open X11
    	mkdir -p $TMP
    	cp -f "$CWD/bin/getdisplay.sh" $TMP
    ....
    
     
  10. leonardo

    leonardo New Member

    Joined:
    Mar 17, 2008
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    The  '# open X11' at the end just before 'mkdir  -p  $TMP' was missing from my script file. I added it and my script file looks exactly like yours:

    # tiger or before
    if [ $OSXVER -lt 9 ]; then

    # modify X11 config file by commenting out 'xterm',
    # so that we're not annoyed by a xterm window on startup
    ps -wx -ocommand | grep -e '[X]11' > /dev/null
    if [ "$?" != "0" -a ! -f ~/.xinitrc ]; then
        echo "rm -f ~/.xinitrc" > ~/.xinitrc
        sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> ~/.xinitrc
        fi
        echo "rm -f ~/.xinitrc" > ~/.xinitrc
        sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> ~/.xinitrc
    fi
    # open X11
    mkdir -p $TMP


    but the xterm window still opens on start up.

    At the bottom of the Smultron window it says "Encoding: Unicode (UTF-8)" if that means anything.
     
  11. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    hmm in what you pasted the 'sed' and 'echo' commands appear twice?
    #open x11 is just a comment so should make no difference

    one last try : I attached my own script file to this post, can you download it and test? this will be easier :)
     

    Attached Files:

  12. leonardo

    leonardo New Member

    Joined:
    Mar 17, 2008
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    I'm astonished that I didn't notice the double entry and said our files looked exactly alike. I must have duplicated it trying to figure out how to use Smultron. I have no idea what I'm doing and now my eyes must be glazing over.

    Anyway I downloaded your script and it opened in Smultron and I don't know what to do next. Smultron Help seems to be written for people who already know what they're doing and I don't. 

    Auria, could you please guide (program!) me with step by step instructions for an empty mind? I didn't get a chance to look into X codes or MacPorts.

    Is this what we're working with:

    X code on the "build/package" (for Tiger OS on PowerPC) from MacPorts for X11 window manager?

    I really would like to know what I'm doing. When we're finished here I'm going try to work X codes and MacPorts into my schedule.

    Thanks again for your continuing efforts.
     
  13. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Sorry, I don't understand at all your last post.

    We're just editing a script, no need for XCode, amcports, or anything. Smultron is just a programmer's text editor; you don't need to use all its features. Use it like any other text editor, there's nothing special to learn

    If you're interested in building GIMP itself there's a topic for that, but that's a totally different question, not related to what we are trying to solve here

    All you need to do is right-click on Gimp.app, select show package contents, open Contents, open Resources, and replace the file called "script" that you can find there with mine. Then open GIMP
     
  14. leonardo

    leonardo New Member

    Joined:
    Mar 17, 2008
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    All you need to do is right-click on Gimp.app, select show package contents, open Contents, open Resources, and replace the file called "script" that you can find there with mine. Then open GIMP

    That was what I was looking for and you thought I already knew that and I didn't. I'm just too new at all this.

    So I Control clicked on GIMP app > Show package contents > Contents > Resources > drag downloaded script into Resourses > window opens asking do I want to replace script? > Replace. So easy when you're told exactly what to do.

    Opened GIMP and xterm window did not open. Hurray! ;D

    Thank you very much Auria!

    P.S. I still have no idea what this nameless script belongs to or is part of and I would like to know. It's packaged with the GIMP app so I'm guessing it must be part of the "build/package" that controls the X 11 window manager. I'm guessing the build/package was built with MacPorts (what ever they are) using X codes. I just want to understand how it all fits together and I'm surprised I can't get an answer. Am I even close?  :question:
     
  15. Auria

    Auria Member

    Joined:
    Mar 16, 2008
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Thanks, I will commit the fix, so all new versions should have the fix :D

    This script is part of the app skeleton.

    Macports fetches the source code of GIMP, GTK, and everything else GIMP needs to work. It builds them and installs them in a Unix style, that can be opened from the X terminal
    In order to distribute a package that users can download and double-click like other OS X apps, we need to place the files into an application, and have this application launch X, then gimp, and take care of stuff like documents dropped on the icon in the dock. That's what the app-skeleton and launcher do. This part coded by us (and the people before us), not by macports.
     

Share This Page