Jump to content

Desktop Icons, custom scripts, etc


4 posts in this topic

Recommended Posts

I'm fairly new, got my first hackintosh going, worked through a bunch of preliminaries & learning, and hope to learn a lot more about the platform.

I'm coming from more of a Linux background, and one of the things I want to do is port a few things to a mac, some of which I can do with bash scripts,etc.

One thing I'm noticing, is there not a way to create desktop icons that will run apps and scripts or links to open a specific browser and URL right on the desktop, and not have to resort to putting them in the dock at the bottom?


I'd like to have at first 3 icons:


One which will open a bash script to run a DOS emulator which would open a DOS window and prompt to have a serial port device upload data onto the hard drive


Second which would run a similar script to open up the data in a text editor so that it could be printed out


Third, an icon which would open a third party browser like Firefox to a particular URL (which would be my localhost Apache site [also having a mysql backend])


Basically just icons where a command could be embedded within them so by double clicing the action would happen, and have them be staring at the user on the desktop rather than in the dock. I may be overlooking something obvious, but it seems the icons on a Mac so far only are used for mounted volumes. (I'm very new)


Basically, what I'm not seeing is when you right click on the desktop, an option like KDE or Gnome has for "add link to application" where you can also pick an icon for it.

Link to comment
Share on other sites

Ok. Macs are a little different. Yes you can make a script (with Applescript) that will open a firefox to a specific web page. My favorite way is to basically just make it my home page. Secondly, there is no right click menu with the new file thing like Windows and Linux. Your desktop dir is /Users/YourName/Desktop in mac, so you can save files there, and they appear on the desktop. You can drag files and folders, and apps there too. You can also make an alias, which is like a shortcut, but you can move both that and the original file, and it still works. They are the perfect link. The dock is both a place for running things, and a place to store commonly used things. You don''t HAVE to keep things there to run them. Need anything else?

Link to comment
Share on other sites

Thank kdb,

That was very helpful. I played with it and figured out what works so far from what you said. I was able to drag an app onto the desktop (had to hold the alt key so I got a "plus"), and also create a script


cd Desktop

touch test

nano test



open -a Safari http://www.google.com



chmod a+x test


Then double-click on it and it works.


and so forth. So what I need to do works. The terminal window stays open afterwards so far, and I can't change the icon to a picture (may need a 3rd party app for that),

but it's a good start.

Link to comment
Share on other sites

OK, I can get the window to close automatically if I put killall -9 Terminal

as the last line in the script, and I can change the icon with one already on my system using the app "Candy Bar", so far so good.

So pointing the script to Safari to open http://localhost/

I can get it to start my PHP/MySQL application, which was basically the main point. But using killall would also close other terminal windows, probably the use would not have one of those going concurrently anyway.

Link to comment
Share on other sites


  • Create New...