Wednesday, August 18, 2010

Mac OS theme on Ubuntu 10.04 (Lucid)

Installing Mac OS theme on Ubuntu 10.04 (Lucid) is easy and straightforward. 

Step 1:  Install Gstyle (Gstyle is a full Gnome Theme Manager)
             sudo add-apt-repository ppa:s-lagui/ppa
             sudo apt-get update
             sudo apt-get install gstyle
Step 2:  Once it is installed successfully. Launch Gstyle application (System -> Preferences - > Gstyle).
Step 3:  Click on Download button and then Click on Refresh button.  Select Mac4Lin theme from the list.
Step 4:  Then in each category option in the left panel of Gstyle, select Mac4Lin. I choose Mac4Lin Aqua.
Step 5A:  Now to Configure Global Menu (Top panel bar). Perform following steps:
             sudo add-apt-repository ppa:globalmenu-team
             sudo apt-get update && sudo apt-get install gnome-globalmenu
             killall gnome-panel
Step 5B:  Once done, remove all stuffs from top left panel (Right click on the panel and select “Remove from Panel”).  Right click on the top panel and select Add to Panel. Select Main Menu, follow by the Global Menu Panel Applet. Close the window. Now move the two items (right click and select Move) to the left hand corner and make sure they are side by side.

Step 6A: Now to configure Dock (Bottom panel bar). Perform following Steps:
            sudo apt-get install cairo-dock
            There are lot of dock application, but I found this one is easy to use. 
Step 6B: Before you launch the Cairo dock application, remove the bottom panel (right click at the bottom panel and select Delete This Panel).  Cairo dock needs a compositing manager to work, so make sure that your system support Compiz before launching the app. Launch Cairo dock (Menu -> Accessories -> Cairo Dock). Make sure to set it to launch everytime you startup your computer.

             Only if your system does not support Compiz: You can activate the in-built metacity compositing manager with the command:
            gconftool-2 --type boolean --set /apps/metacity/general/compositing_manager TRUE 

To change the logo in the panel bar with apple logo:
1. Download apple logo from google.
2.  Then go to /home/urprofilename/.icons/Mac4Lin_Icons_v1.0/scalable/places folder.  Check the resolution of distributor logo.png file. It may be 78 * 96. Now rescale the image you downloaded into 78 *96 or 96*96 size.
3. Then replace distributor-logo.pnggnome-main-menu.pngmain-menu.png, and start-here.png with the apple logo file.
4. Open the terminal window and type  killall gnome-panel to restart the gnome-panel. Now you should see your new icon. 

Monday, August 16, 2010

How to create Patch on Liunx?

In this post I will explain how to create a patch file and how to apply patch.
I only know the basic stuff. Therefore, if you want to know more then please use command man diff at command prompt to explore other possible options.

How to Create a Patch File?
Patch file is a readable text file which is created using diff command.
To create a patch of entire source folder including its sub directories, do as follows:

 $ diff -rauB  old_dir   new_dir   >  patchfile_name

  options -rauB mean:
  r  -> recursive (multiple levels dir)
  a ->  treat all files as text
  u -> Output NUM (default 3) lines of unified context
  B -> B is to ignore Blank Lines

Blank lines are usually useless in the patch file.  Therefore I used B option, however you are free to tune your patch file according to your choice.
old_dir is the original source code directory,  new_dir is the new version of source code and patchfile_name is the name of the patch file.  You can give any name to your patch file.

How to Apply Patch to your Source Code?
Suppose you have got a patch file and you want to apply that patch to the version of your source code.
It is not necessary but I recommend to do a dry-run test first.

To do a dry run:
$ patch --dry-run -p1 -i patchfile_name

-i : Read the patch from patchfile.
-pnum : Strip  the  smallest prefix containing num leading slashes from each
          file name found in the patch file.  A sequence of one or more  adjacent
          slashes  is counted as a single slash.  This controls how file
          names found in the patch file are treated, in  case  you  keep  your
          files  in  a  different  directory  than the person who sent out the

If there is no failure then you can apply patch to your source code:
patch -p1 -i patchfile_name

I hope this post will help you to generate patch from your source code and apply patch to your source code.

Saturday, August 14, 2010

How to Build Lobo browser on Ubuntu 10.04

 1. Eclipse SDK for Java.
 2. IzPack ( Download cross platform installation jar file.

1. Create a sudirectory "XAMJ_Project" in /opt folder.  In linux, /opt belongs to root user so you may need to change the owner of /opt folder, so that write operation will be allowed.

2. Install IzPack in "/opt/IzPack". for installation of IzPack at command prompt run the command: java -jar IzPack-install-x.x.x.jar.

3. Open Eclipse and change workspace path to "/opt/XAMJ_Project".

4. Now choose the Project Explorer (Window->Show View -> Project Explorer).

5. Right click in project explorer and select New -> Project -> CVS  - > Project from CVS.
6. When prompted for server details fill out the server details as given in step 3 of Lobo Eclipse build instruction page.   
Repository path: /cvsroot/xamj
User: anonymous
Password: [leave blank]
Connection type: pserver

  7.  Next, select "Use an existing module" option.

  8.  Then select 8 modules from the XAMJ_Project folder for basic web browser build.  You can choose all modules.  eight modules I choose were as follows:    

  • Common
  • cssparser
  • HTML_Renderer
  • Platform_Public_API
  • Platform_Core
  • Primary_Extension
  • XAMJ_Build
  • IzPack_RegistryPanel
 9. Next select the version of repository and check out.

 10.  Now right click on "IzPack_RegistryPanel" select "Properties" . Then select "Java Build Path".  select the "Libraries" tab. 

  11. If you see cross for some libraries then its bcoz of the wrong path. As we have already installed IzPack, search for files in /opt/Izpack/lib or /opt/IzPack/bin/Panel, and correct the paths of library files. 

  12. Now configure "Run Configuration" for your Java Application project. Please see the README.txt file in Platform_Core for instructions, and set VM Variable and Program Variable in the Arguments tab according to the README.txt file.  Also set the  Project name and Main class name in the Main tab.  The name of the main class is org.lobobrowser.main.EntryPoint .

13. Now apply your setting and run the project. It should work. If it doesn't then right click on IzPack_Registry Panel and add libraies: xpp3-, and You can search and download these libraries if they are not present.