Results 1 to 11 of 11
  1. #1
    nanoo
    Guest
    Custom application launchers in Dock? [RESOLVED]
    Hi,

    I'm wondering whether anyone has explored putting custom application launchers in their Dock. It was, of course, easy to add applications that already had an icon to the Dock (just by dragging), however I had something else in mind: I want to get an application launcher for XMMS in the Dock as well if possible. I have XMMS installed through FINK, and it works great, the only problem being that to launch it I must first start up X11, run /sw/bin/xmms, enter my password, etc, etc. Is it possible to avoid all that by programming an application launcher that I can keep right in the Dock? I've looked around (mostly just googling variations on this theme) and haven't found anyone who has done this... anyone have any hints/advice?

    Thanks in advance,

    nanoo

  2. #2

    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    Look at an app called Platypus I believe that's what it's called. You can find it on macupdate.com

  3. #3
    nanoo
    Guest
    Thanks for the reply Murlyn - I think this Platypus is exactly what I'm looking for. I think I have a problem with the code however... I think to do with getting X11 to start up. I don't really know anything about programming - just the basics to get by on a Mac or *NIX system - if anyone can help me here I would really appreciate it.
    So this is what I had in the file that I want Platypus to launch to get XMMS up and running:

    Code:
    #!/bin/sh
    
    # An attempt to launch xmms in the Tiger interface
    
    /sw/bin/xmms
    So I created an application launcher with that using Platypus, but it gives as output:

    Code:
    *** CRITICAL ***: Cannot open display
    Any ideas? Is it an X11 thing?

    Thanks,

    Daniel

  4. #4

    Murlyn's Avatar
    Member Since
    Jun 11, 2003
    Location
    Mount Vernon, WA
    Posts
    4,915
    Specs:
    MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
    I have no idea.. hopefully someone else does.

  5. #5

    rman's Avatar
    Member Since
    Dec 24, 2002
    Location
    Los Angeles, California
    Posts
    12,584
    Specs:
    2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi
    Cool
    It is an X11 thing. The application that you are running does not have permission to display anything on your display window.

    Normally you would do an xhost "ip address" (.i.e xhost 169.230.14.5) or xhost +. Then you would sst your display to your ip address. If you are uingin korn shell you would issue the command export DISPLAY 169.230.14.5:0. Bourne shell DISPLAY=169.230.14.5:0; export DISPLAY and c shell setenv DISPLAY 169.230.14.5:0.
    Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!

  6. #6
    nanoo
    Guest
    Thanks rman, I think that exporting DISPLAY business is exactly what I need. I have hit another snag though...
    I changed the script to:

    Code:
    #!/bin/sh
    
    # An attempt to launch xmms in the Tiger interface
    xhost 169.230.14.5
    DISPLAY=169.230.14.5
    export DISPLAY
    /sw/bin/xmms
    and now I get the following output:

    Code:
    /Users/nanoo/Desktop/xmmslaunch.app/Contents/Resources/script: line 4: xhost: command not found
    
    ** CRITICAL **: Unable to open display
    So the problem clearly is that it can't find xhost... and I can't find it either. I've looked all over for it - I can't find any of my X stuff anywhere on my system. Is there a place where these things normally live? I have XFree86 4.4.0 on my Mac system.

    At any rate, if anyone knows where I can find the files for X11 (isn't there normally an X11 folder somewhere?), I'd really appreciate it - I think that's all I need to get this working ,

    Thanks,

    nanoo

  7. #7

    rman's Avatar
    Member Since
    Dec 24, 2002
    Location
    Los Angeles, California
    Posts
    12,584
    Specs:
    2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi
    Cool
    Do you have the X11 windowing system installed on your system? Because xhost is part of that system.

    Also in your script, you will need to modify the line "DISPLAY=169.230.14.5" to "DISPLAY=169.230.14.5:0".
    Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!

  8. #8
    nanoo
    Guest
    Thanks for catching that typo rman - I neglected to check that.

    Ok, so I found xhost (I had thought that my whole system was in the /sw - it turns out that the usr folder and others are in the root directory), and that settles that problem, however it doesn't seem to be able to open the display. This is the output it gives:

    Code:
    /usr/X11R6/bin/xhost:  unable to open display ""
    This is the script the launcher pointed to (I corrected the typo before running the launcher):

    Code:
    #!/bin/sh
    
    # An attempt to launch xmms in the Tiger interface
    /usr/X11R6/bin/xhost 169.230.14.5
    DISPLAY=169.230.14.5:0
    export DISPLAY
    /sw/bin/xmms
    I checked that the script was executable (permissions are 755), but other than that I couldn't think of why launcher wouldn't work.

    Any ideas? Thanks for all the help so far - I've got to be close at this point!

    nanoo

  9. #9

    rman's Avatar
    Member Since
    Dec 24, 2002
    Location
    Los Angeles, California
    Posts
    12,584
    Specs:
    2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi
    Cool
    You can try xhost + and see if that will work.
    Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!

  10. #10
    nanoo
    Guest
    Thanks again for the help rman. Unfortunately xhost + didn't work - the same result as when I gave an explicit IP address.
    However I think I made some progress this morning: I realized that it was only when I typed
    Code:
    /sw/bin/xmms
    in an xterm that I could get it to launch.
    When I tried it in a terminal, I got the same error message that the platypus program was giving me. Sure enough, when I would run:
    Code:
    /usr/X11R6/bin/startx
    and then
    Code:
    /sw/bin/xmms
    in the xterm that came up, then xmms launched with no problems.

    So of course the next thing I tried was to change the script to:
    Code:
    #!/bin/sh
    
    /usr/X11R6/bin/startx
    /sw/bin/xmms
    However I noticed that the launcher seemed to hang after starting X. So my problem is this:
    Is it possible to write a program that will start X, then run new scripts in the xterm that comes up? When I do this manually everything works great. It's just a matter of getting it to work in one single script, that I can attach to a launcher.

    As before, any help would be greatly appreciated.

    Thanks,

    nanoo

  11. #11
    nanoo
    Guest
    Well, it turns out the solution to my problem was so simple...
    I simply dragged the xmms icon in /sw/bin to the dock, and it worked perfectly (it knew to launch it with X11), and so the script problem has become totally moot.

    Thanks for the help!

    nanoo

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 03-22-2014, 08:30 PM
  2. Application Maintenance from Dock and Application Folder
    By ZoSo0789 in forum Switcher Hangout
    Replies: 2
    Last Post: 08-05-2010, 08:07 AM
  3. Custom Nightstand Dock
    By walsh-16 in forum iPhone Hardware and Accessories
    Replies: 5
    Last Post: 01-02-2010, 03:41 AM
  4. Custom made iPhone dock
    By farmdreads in forum iPhone Hardware and Accessories
    Replies: 0
    Last Post: 03-20-2009, 01:45 PM
  5. Custom application methods
    By MrPotatoes in forum OS X - Operating System
    Replies: 3
    Last Post: 03-03-2008, 10:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •