March 16, 2011, 2:22 p.m.
posted by oval
Use Your Windows Desktop Settings
Believe it or not, your underlying Windows system isn't completely useless while running Knoppix. You can leverage your underlying Windows system for settings and datafiles.
Quite a few of the applications included with Knoppix, such as Mozilla, OpenOffice.org, and Gaim, actually have Windows counterparts. If you have been using these open source applications under Windows and have them configured to your liking, you can copy the settings for use in Knoppix much like in [Hack #22] . The programs covered here typically use the same configuration files under Windows as they do in Linux. In fact, the only real difference is the location of the configuration files. This hack describes how to copy these settings and how to use some other common Windows file locations under Knoppix.
To use your Windows program settings, locate the Windows equivalent of the /home directory. For Windows 2000 and XP, this directory should be called Documents and Settings and is usually at the root of the C: drive. Click on each of the hard-drive icons on your Knoppix desktop and look for this directory, and find all the user directories that contain user-specific application configuration files. In my examples, the user is called knoppix, so all of the configuration files are stored under C:\Documents and Settings\knoppix.
Mozilla is probably the most likely application you would use both in Windows and under Knoppix. As I mentioned in [Hack #22], Mozilla stores its configuration settings under a directory with a randomly generated name, so you must first find that directory both in /home/knoppix and on your Windows partition. Make sure you run Mozilla under Knoppix at least once, and make note of the directory name under /home/knoppix/.mozilla/knoppix/, which should resemble xxxxxxxx.slt, with each x replaced with a random character. Assuming your Windows partition is hda1, make sure the drive is mounted, open a terminal, and type:
[email protected][knoppix]$ cd /mnt/hda1 /Documents\ and\ Settings/username /Application\ Data/Mozilla/Profiles/default
If you have created special profiles for Mozilla, enter the name of the profile instead of default for this command. Type ls here to reveal a directory named yyyyyyyy.slt, where each y is replaced with a different random character. Now that you have both directories identified, copy the settings with the command:
[email protected][knoppix]$ cp -a yyyyyyyy .slt/* /home/knoppix/.mozilla/knoppix/xxxxxxxx .slt/
If prompted whether you wish to overwrite any files, type y. Now when you start Mozilla you should see all of the same settings that you used under Windows. The prefs.js file, which contains many of your Mozilla preferences, stores a lot of Windows-specific directory paths for email, etc. If you don't mind your home directory being littered with a few oddly named directories, leave this as is. Otherwise, the following search-and-replace script should remedy most of the paths:
[email protected][knoppix]$ perl -pi -e 's|C:.*?Desktop|/home/knoppix/Desktop|; s|\\\\|/|g; s|C:/.*?slt|/home/knoppix/.mozilla/knoppix/xxxxxxxx .slt|' /home/knoppix/.mozilla/knoppix/xxxxxxxx .slt/prefs.*
Be sure to replace each instance of xxxxxxxx.slt with the name of the random profile directory Mozilla created under Knoppix.
OpenOffice.org is another application that you might use under both Windows and Knoppix. Under Windows, OpenOffice.org stores its configuration files along with the program under C:\Program Files\OpenOffice.org1.1.1, with the final part of the directory name differing, depending on which version of OpenOffice.org you have installed. To copy your OpenOffice.org settings to Knoppix, type:
[email protected][knoppix]$ cp -a --reply=yes /mnt/hda1 /Program\ Files/OpenOffice.org1.1.1 /user /home/knoppix/office/
If you want to be prompted for each file that will be overwritten, remove the --reply=yes argument.
3 Instant Messaging and IRC
[email protected][knoppix]$ cp -a /mnt/hda1 /Documents\ and\ Settings/username /Application\ Data/.gaim /home/knoppix/
[email protected][knoppix]$ cp -a /mnt/hda1 /Documents\ and\ Settings/username /Application\ Data/X-Chat\ 2 /home/knoppix/.xchat2.
4 Use My Documents
Making use of your existing application settings is nice, but sometimes you really just want to listen to your music collection. I mean, fill out some TPS reports for work. To make your Windows data readily accessible, create a symlink to your Windows My Documents directory by typing:
[email protected][knoppix]$ ln -s /mnt/hda1 /Documents\ and\ Settings/username /My\ Documents /home/knoppix/Desktop/
Remember to change your Windows partition to have write access if you want to save the changes that you have made.
As you can see, it is pretty easy to make use of configuration files for the applications your Windows and Knoppix systems have in common, and to access your Windows datafiles for use under Knoppix.