Saturday, June 25, 2011

Add Openbox to A debian/ubuntu based install

This will be two part: installing and configuring. 

***********************
INSTALL
***********************
Step 1: Install openbox. 
      sudo apt-get install openbox obmenu

Step 2: Install theme managers.
     sudo apt-get install obconf lxappearance

Step 3: Install a panel/dock. I prefer tint2, but other options exist such as pypanel. This walk through will be for tint2. 
     sudo apt-get install tint2

Step 4: Install feh. Openbox can't set a wallpaper, so feh will be used. 
     sudo apt-get install feh 

Step 5: Install gmrun. gmrun will allow easy access to launch programs.
     sudo apt-get install gmrun

Step 6: Install network manager. You are welcome to substitute the gnome network manager here, but I prefer WICD. If you install WICD you should probably remove network-manager. (sudo apt-get remove network-manager)
     sudo apt-get install WICD

Step 7: Install a file manager. You are welcome to substitute nautilus here, but I prefer PCmanFM. 
     sudo apt-get install pcmanfm

In summary:  
        sudo apt-get install openbox obmenu obconf lxappearance tint2 feh gmrun wicd pcmanfm
*********************
CONFIGURATION
*********************
You'll be using the terminal for most of this so go ahead and open one. 

Step 1: Make a config folder for openbox in your home directory. 
     mkdir ~/.config/openbox

Step 2: Copy the default openbox config files into your home directory. 
    cp /etc/xdg/openbox/rc.xml ~/.config/openbox
    cp /etc/xdg/openbox/menu.xml ~/.config/openbox
    cp /etc/xdg/openbox/autostart.sh ~/.config/openbox

At this point you could log out and log back in selecting openbox session at the login screen, unfortunately you'd log in to a bare openbox session and would probably hate it. So we are going to go ahead and make some configuration changes now. 

Step 3: Edit autostart.sh (This file tells openbox what to run when you start an openbox session)
   Set Wallpaper:
    echo "feh --bg-scale ~/Pictures/wallpaper.jpg &" >> ~/.config/openbox/autostart.sh  
     #Substitute the path to your wallpaper for the bolded text.
   Start tint2:
    echo "tint2 &" >> ~/.config/openbox/autostart.sh
     Start network manager:`
    echo "wicd-gtk &" >> ~/.config/openbox/autostart.sh  
     #you can use network-manager here if you want.
   Start MintUpdate (if you are using linux mint):
    echo "mintupdate-launcher &" >> ~/.config/openbox/autostart.sh 
   Start Volume Manager: 
      echo "gnome-volume-control-applet &" >> ~/.config/openbox/autostart.sh 

Step 4: Edit rc.xml (This file does too much to detail here). We are going to change some key bindings.
   
   Open ~/.config/openbox/rc.xml
    gedit ~/.config/openbox/rc.xml
   
   Scroll down until you see: <!-- Keybindings for running applications -->
   
   Add a key binding for gmrun (under what we just looked for):
    <keybind key="W-r">
        <action name="execute"><execute>gmrun</execute></action>
      </keybind>

     Add a key binding for gnome-terminal:
      <keybind key="W-t">
       <action name="execute"><execute>gnome-terminal</execute></action>
           </keybind> 

     Add a key binding for firefox:
      <keybind key="W-w">
       <action name="execute"><execute>firefox</execute></action>
      </keybind> 

   Add a key binding for PCmanFM:
      <keybind key="W-f">
       <action name="execute"><execute>pcmanfm</execute></action>
      </keybind> 

   Add a key binding for gedit:
      <keybind key="W-e">
       <action name="execute"><execute>gedit</execute></action>
      </keybind>
 
 
   Add a key binding for the openbox menu: 
           <keybind key="W-Space">
            <action name="ShowMenu"><menu>root-menu</menu></action>
           </keybind> 


Step 5: Edit menu.xml (The file that makes your pretty ob menu)
You can edit this file with a text editor. Or use menumaker. Or use obmenu. The key binding for gmrun will allow you to run programs by pressing the windows key + r, and typing the name of the program you want to run, and yes tab will autocomplete in the dialog box.
     
   Download menumaker here:  
     http://sourceforge.net/projects/menumaker 

   Extract menumaker: 
    tar -zxvf ~/path/to/the/file (or go to the folder and right click)

   Move the folder to your home directory.

   Rename the folder to make it hidden: add a period at the beginning of the name.

   Add an alias to ~/.bashrc to run menumaker:
    echo alias mmaker='~/.menumaker-0.99.7/mmaker -vf Openbox3' >> ~/.bashrc
     #if you download a different version or save it into a              different location change the path...
    
When you log in to openbox for the first time, open a terminal and run mmaker to create a menu. Then feel free to edit the .xml with obmenu or a text editor.    
**************
FINAL TOUCHES
**************
When you are at the log in screen select openbox session, instead of gnome session, and log in. You should see something similar to this, of course with your background and default tint2 and no running programs:
To change your gtk-theme and icons use lxappearance. Launch it with gmrun or a terminal. To change your openbox theme use obconf. Launch it with gmrun or a terminal. 

//If you know of a better way of doing things feel free to //comment. If you have any questions don't hesitate to ask.

Monday, June 13, 2011

Old Desktop + SSH = Priceless

     I've had an old Dell tower laying around for a while. A year or so ago I used it to test out distros without the fear of botching up my main PC, and for a minute I believed I might actually start using that lovely Pentium 4 again for daily tasks. Then I realized that I don't use desktops. I use laptops. VortexBox sounded like a great idea. For those who don't know, and are too lazy to click the link, you pop in a CD full of music and it automatically gets ripped and tagged. On top of that the cover art gets downloaded, and you have a lovely little multimedia streaming device. Then I realized that my 30GB hard drive wouldn't hold that many music files, especially music files that have .flac on the end. After a year of collecting dust the old relic has returned to life...as a server. 
     I considered a LAMP server, then I realized I don't need a LAMP server. What I do need is a place to store 15 or 20 distributions that I keep hopping and a handful of files I'd really like to back up in a secure-ish place. Ubuntu Server made it pretty mindless. And now for a pretty abstract step by step. 
  1. Download Ubuntu Server
  2. Install Samba and OpenSSH (and CUPS if you want)
  3. Make IP address static. 
  4. Filezilla. 
     For now I'll leave it at this, and let you learn the power of www.google.com