Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create a shadow Applications folder with lndir UNIX
In the good old days of OS 9, one could move programs anywhere on the drive. Unfortunately with OS X, (Apple) programs need to be in particular places for updates to work properly. Using lndir (which I think comes with XFree86 via fink) you can make a 'shadow' directory of Applications, and organize them to your hearts content!

The command, assuming lndir is installed is:
 % cd
 % mkdir shadow
 % /usr/X11R6/bin/lndir /Applications ~/Shadow
This will make the shadow directory in your home folder, and populate it with links to the real applications which reside in /Applications. Next sort the files as you like eg: productivity, multimedia, etc. You can then drag the Shadow directory onto the Finder sidebar in 10.3 for quick (organized) access.

For those who hate eyesores:
 % sudo /Developer/Tools/SetFile -a V ~/Shadow
Note: you will have to enter the admin password. This will make the Shadow directory invisible to the Finder.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[6,639 views]  

Create a shadow Applications folder with lndir | 11 comments | Create New Account
Click here to return to the 'Create a shadow Applications folder with lndir' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a shadow Applications folder with lndir
Authored by: diamondsw on Dec 15, '03 12:31:35PM

Although /usr/X11R6/bin/ does not appear in the default PATH, I can verify that Apple's X11 installation on Panther includes lndir. (Note that I installed the SDK as well...)



[ Reply to This | # ]
Create a shadow Applications folder with lndir
Authored by: diamondsw on Dec 15, '03 12:38:01PM

Another great use of this is to create lightweight images of offline disks. If you create these shadows on a disk image and compress it, it works *very* well.



[ Reply to This | # ]
lndir vs. soft links and aliases
Authored by: gjm25 on Dec 15, '03 05:01:25PM

What is the difference/advantages between lndir and doing ln -s * for the applications dir? Or, as I have done, create aliases of all the applications? I would like to check one thing - I have made all my aliases and put them in folders, but is there an easy way to check that I have not missed any apps? or just wait until I can't find it?



[ Reply to This | # ]
lndir vs. soft links and aliases
Authored by: jzsimon on Dec 16, '03 09:42:35AM

It looks to me like lndir is recursive. Also, it makes soft links only to files but makes new true directories in the shadow directory.

That explains why the shadow applications don't have an alias icon: the .app directory is real; only the files within are links.



[ Reply to This | # ]
Create a shadow Applications folder with lndir
Authored by: bluehz on Dec 15, '03 07:46:42PM

Wow! Thats impressive. Never knew that existed. Nice thing is - as opposed to making links with ln - these links look and feel Mac. They have proper icons and are double-clickable.

Puts a pretty high strain on my older machine while creating the links. Wonder what the impact would be if you scripted this to cron every night at a certain time. I mean does it go through the whole process again - rebuilding each link OR does it simply add/remove (ala sync) the links?



[ Reply to This | # ]
Create a shadow Applications folder with lndir
Authored by: GaelicWizard on Dec 16, '03 03:38:39AM
Nice thing is - as opposed to making links with ln - these links look and feel Mac. They have proper icons and are double-clickable.
It is very kool, and mac like, but if you read the man page it states that:
The lndir program makes a shadow copy todir of a directory tree fromdir, except that the shadow is not populated with real files but instead with symbolic links pointing at the real files in the fromdir directory tree.
So it is actually *exactly* like what you get with ln -s since that is what it does. :-)

---
Pell

[ Reply to This | # ]

Create a shadow Applications folder with lndir
Authored by: GaelicWizard on Dec 16, '03 03:31:42AM
please note that sudo is NOT required (or recommended) for the SetFile -a V command, don't use sudo if you don't need to.

---
Pell

[ Reply to This | # ]

Create a shadow Applications folder with lndir
Authored by: ether on Dec 23, '03 12:18:19PM

This is a great hint, but is there any way to get lndir without installing X11?



[ Reply to This | # ]
Create a shadow Applications folder with lndir
Authored by: area51 on Feb 17, '04 03:22:37PM

I tried this and it worked to for the most part. Some application links lost their icons (Calculator, iChat, and Image Capture). The same thing happened to some folder icons (became generic). Finally a lot of files such as all the .scpt files deep inside the AppleScript folder have alias icons. Does anyone know why?



[ Reply to This | # ]
Create a shadow Applications folder with lndir
Authored by: ether on Feb 19, '04 04:32:49PM

The only problem with this is maintenance.

What happens if you add new applications? Do you have to manually create shadows of them and then add them to the shadow dir?

ditto if software update changes an app?



[ Reply to This | # ]
bash oneliner for same
Authored by: wmertens on May 14, '04 07:56:52AM
This is how I did it with bash, without needing lndir

find /Applications -type d -name \*.app -print -prune | while read i; do
    a=~/"$i"/; if [ ! -d "$a" ]; then
        echo Linking "$i"
        mkdir -p "$a"
        for j in "$i"/*; do
            ln -s "$j" "$a"
        done
    fi
done
Just cut'n'paste it into a Terminal (bash will handle the newlines just fine), run it, and you will have a full tree with only the bare minimum of links needed for it to work.

[ Reply to This | # ]