|
|
running generatelinks.sh
Rob mentions using "cron or some other mechanism to run the generatelinks.sh script". If I understand the way it works, launchd would be a great "other mechanism" because it can be configured to run generatelinks.sh whenever the /Applications directory is changed. You could create a new plist for launchd in ~/Library/LaunchAgents (since it only needs to be active when you're logged in) and include something like this in the file:
The only thing I wonder about is whether or not launchd considers you to be "logged in" if you come in remotely via SSH, but I suppose in that case, you're not likely to modify the Applications folder or launch the applications themselves.
running generatelinks.sh
So I would need to create the folder LaunchAgents if it doesn't exist and then put a .plist file in that directory with
as the only text? Do I need to have a special name for this file and is there anything I need to do to have launchd start checking it? (i.e. restart the service or log out/ log in)
Thanks!---
running generatelinks.sh
the file gotta look s/th like this:
of course you should adapt the path to the script AND the username. you can make this plist with launchd editor (its on vt, me thinkin) or with the plist-editor (its on your system).
the you tell osx to add it to launchd-services:
again adapt paths. if you now add s/th to /Applications/ you'll notice the find-process in top.
but this way, if you remove apps, they aren't removed from your list. you gotta add s/th like "rm ~/Apps/*.app" to generatelinks.sh for this. then everytime you s/th to /Applications/ the complete list of links is rebuild.
this could be a problem with apps writing in their app-bundle though, as the find-command takes its time...
regards, n.
running generatelinks.sh
Thanks! Works great. I changed the code of the original script a bit to be more conducive to a background task:
This will verify if the symlink exists first, otherwise when it tries to overwrite it generates an error. It will also output the names of the links it creates to the system log, rather than to stdout, which running within launchd isn't really visible. This doesn't cover the problem with apps removed, but simply doing an rm ~/Apps/*.app periodically should fix this.---
running generatelinks.sh
So I would need to create the folder LaunchAgents if it doesn't exist and then put a .plist file in that directory with
as the only text? Do I need to have a special name for this file and is there anything I need to do to have launchd start checking it? (i.e. restart the service or log out/ log in)
Thanks!---
running generatelinks.sh
Oops, accidental double-click...sorry for the dup. post. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|