Hacking Cog to have an iTunes style library
Hacking Cog to have an iTunes style library
I use Cog on OS X as my primary music application which I’m pretty happy with - It’s very lightweight and plays FLAC files. Still, I prefer how Rhythmbox and iTunes manages your music in one large library. Cog, on the other hand, gives you a directory listing and requires you to drag and drop files into a library to listen to them.
This post describes a way to make Cog work more like iTunes. The library for Cog is simply a m3u playlist file on the filesystem. I wrote a script that would overwrite the m3u file with list of files in my music directory whenever you run Cog. To do this:
- Rename the actual Cog application (within the /Applications/Cog.app folder). In the terminal,
- Create a shell script to masquerade as Cog. This will first update the Cog m3u file, then run Cog. Copy the script below in a file called ‘Cog’ and place it at /Applications/Cog.app/Contents/MacOS/
You will want to modify the script. Change the LIBRARY_FOLDER
to point to a directory where all of your music files are located. You’ll also want to add or remove the find statements to find the type of music files you are looking for (flac, mp3, ogg, etc).
- Set the permissions on the script to make it executable
Now whenever you run Cog, the library will be updated with your music files. If you add music files to your music directory, you will need to restart Cog.