New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

OS 10.4 - Custom application launchers in Dock?


Post Reply New Thread Subscribe

 
Thread Tools
nanoo
Guest
 
Posts: n/a

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
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
Look at an app called Platypus I believe that's what it's called. You can find it on macupdate.com
QUOTE Thanks
nanoo
Guest
 
Posts: n/a

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
QUOTE Thanks
Murlyn

 
Murlyn's Avatar
 
Member Since: Jun 11, 2003
Location: Mount Vernon, WA
Posts: 4,909
Murlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to allMurlyn is a name known to all
Mac Specs: MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2

Murlyn is offline
I have no idea.. hopefully someone else does.
QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,591
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac 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

rman is offline
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!
QUOTE Thanks
nanoo
Guest
 
Posts: n/a

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
QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,591
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac 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

rman is offline
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!
QUOTE Thanks
nanoo
Guest
 
Posts: n/a

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
QUOTE Thanks
rman

 
rman's Avatar
 
Member Since: Dec 24, 2002
Location: Los Angeles, California
Posts: 12,591
rman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud ofrman has much to be proud of
Mac 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

rman is offline
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!
QUOTE Thanks
nanoo
Guest
 
Posts: n/a

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
QUOTE Thanks
nanoo
Guest
 
Posts: n/a

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
QUOTE Thanks

Post Reply New Thread Subscribe


« Version code names? | How can I use a DVD-rw as a hd-drive »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Adium Contact list and Dock Benjamindaines OS X - Apps and Games 3 09-02-2007 11:56 PM
centering the dock daughter_anna Schweb's Lounge 8 06-01-2005 05:03 PM
Transparent Dock MactotheMax OS X - Apps and Games 6 05-21-2005 04:25 PM
Break down the dock for me? vonedaddy Switcher Hangout 5 02-06-2005 04:53 PM
Custom Internet Application Randomly Freezing rlecjr OS X - Development and Darwin 0 08-27-2004 10:40 AM

All times are GMT -4. The time now is 02:50 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?