Jump to content

Desktop Icons, custom scripts, etc


  • Please log in to reply
3 replies to this topic

#1
frank754

frank754

    InsanelyMac Protégé

  • Members
  • Pip
  • 15 posts
  • Gender:Male
  • Location:Pennsylvania
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.

#2
kdb424

kdb424

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 195 posts
  • Gender:Male
  • Location:Right Here, USA
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?

#3
frank754

frank754

    InsanelyMac Protégé

  • Members
  • Pip
  • 15 posts
  • Gender:Male
  • Location:Pennsylvania
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

#!/bin/bash
open -a Safari http://www.google.com
exit

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.

#4
frank754

frank754

    InsanelyMac Protégé

  • Members
  • Pip
  • 15 posts
  • Gender:Male
  • Location:Pennsylvania
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.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy