Installing Openbox on Foresight Linux

My friend Og Maciel originally introduced me to Openbox a while back and I’ve been using it ever since. I love the lightweight feel, the ability to customize and the center around having NO icons on my desktop.  I don’t feel cluttered when I work! Today, we’re going to go over installing Openbox with some added tools.  This tutorial is tailored for Foresight Linux but the guide may very well serve other distros as well.

What is Openbox?

From the Openbox homepage, “Openbox is a minimalistic, highly configurable, next generation window manager with extensive standards support.”  From using it, I often think of it as fluxbox-like with the benefits of being able to dip into Gnome or KDE for the items that I want to use.  Your desktop will then run with speed and simplicity using only the elements you want to use with it.

So…Let’s get Started…

This How-To will assume that you’re running Foresight Linux, you’re logged into Gnome and that you’re familiar with conary, the package manager for Foresight.  First and foremost, install openbox:

[devnet@lostlap Desktop]$ sudo conary update openbox obmenu obconf

This installs the needed components to run Openbox on your system. Openbox is minimal by default though so if you login to the environment now for the first time, there will be no taskbars, nothing…just a large blank area for you to work with. We will need to install some extra components to give a bit more functionality. If you’d like a panel menu, I recommend using tint2. I used to use pypanel which is a small panel written in python but this panel is no longer developed.

There are other panels that are packaged with openbox in mind for Foresight; fbpanel is available, which is a very fast and functional menu bar. I like lxpanel also, which is fbpanel with some easier configuration options. For a full list, please see openbox documentation. For our purposes here, we will install tint2:

[devnet@lostlap Desktop]$ sudo conary update tint2

Now we need to copy the default configuration file for tint2 so we can build our panel to our liking.  You’ll have to create the default path for the tint2rc configuration file.  To do this and copy the config file:

[devnet@lostlap Desktop]$ mkdir -p ~/.config/tint2/
[devnet@lostlap Desktop]$ cp /etc/xdg/tint2/tint2rc ~/.config/tint2/

Now tint2 has a configuration file in place and is ready for Openbox to start.

Let the Configuration Begin!

The hard part (install) is now out of the way thanks to the conary package manager. Now we need to configure Openbox so that it’s ready for us when we log out of Gnome. The configuration files will need to be copied to /home/user/.config/openbox.  Of course, this path doesn’t exist yet so we’ll need to create it like this:

[devnet@lostlap Desktop]$ mkdir -p ~/.config/openbox/

Visiting there now will show that there aren’t any files in this directory.  The file we’ll absolutely need to place there is autostart.sh. Other files that will be in here are rc.xml which is for obconf (openbox configuration) and menu.xml (openbox menu system).  We’ll copy menu.xml from a default copy there later.  The other file should auto-create when loading for the first time (rc.xml)

The autostart.sh file is what starts all of our services and our tint2 panel we just installed as well as setup our wallpaper and other items.  Instead of going through the options you can place in here, I’m going to share my autostart.sh to get you up and running quickly.  Please note that if you chose not to install fbpanel and use the gnome-panel or other panel instead, you’ll need to comment the pypanel line below and uncomment what you’ll be using:

[devnet@lostlap Desktop]$  cat autostart.sh
# This shell script is run before Openbox launches.
# Environment variables set here are passed to the Openbox session.
##############################################################
# Panel Section
##############################################################
# pypanel, my favorite panel for openbox
#(sleep 3 && pypanel) &
# Use the wbar Launcher if you would like.  Don't forget to install it before uncommenting
# wbar &
(sleep 3 && tint2) &

#############################################################
# Gnome Integration Section
#############################################################
# This section let's Gnome give us some of its desktopiness
gnome-power-manager &
nm-applet --sm-disable &
/usr/libexec/gnome-settings-daemon &
gnome-volume-manager --sm-disable &
gnome-keyring-daemon &

###########################################################
# Other Add-on's for Openbox
###########################################################
# Make your wallpaper restore to last setting using Nitrogen.
nitrogen --restore &
parcellite &
volumeicon &
################################# End ###################

Download my autostart.sh

To create the menu system file for openbox, we’ll copy from the default installation to our .config/openbox directory (so we can use obmenu…otherwise, that command will give us an error) so use the following command in a terminal:

[devnet@lostlap Desktop]$ cp /etc/xdg/openbox/menu.xml ~/.config/openbox/

Now you’re ready to login and reap what you have sown :) Logout of Gnome and change sessions in GDM to Openbox.  Notice that your tint2 panel starts up and has the gnome applications we recorded in the autostart.sh file above running and docked! You can add more options to your autostart.sh file and you can also edit tint2rc (in your /home/user/.config/tint2 directory) to store settings for your panel.

I’ve Installed and am Running, Now What?

Now you get to customize the Openbox menu with your favorite applications. Menus are activated by right clicking anywhere on the desktop. There are a few default applications…I choose obconf right away so that I can choose a theme I like and increase the text size since I’m using a high resolution. After that is done, I right click for the menu again and go to applications >> xterm. When the terminal pops up, I type obmenu. From there, I’ll be able to edit my right click menu.

Now instead of entering obmenu in a terminal each time, let’s add it to our right click options. In the obmenu window that you opened in the last paragraph, expand the Openbox 3 option. Find obconf and highlight it. Click ‘new item’ and add obmenu for a label, execute for action, and obmenu for Execute. This will add obmenu to your right click options so you don’t have to open a terminal each time to do things. You can also customize any of the items you find in applications…I put a few things I normally need such as thunderbird, firefox, gnome-terminal, etc. Feel free to add whatever you need…you can have many submenu’s . It’s setup is pretty straightforward.

Nitrogen, the wallpaper manager, requires a small tweak as well to get working. What I did was create a /home/username/Photos/Wallpaper directory and then loaded it up with my favorite desktop wallpaper. Good places to go for cool wallpapers are desktopography.com and vladstudio.com.  Next, install Nitrogen:

[devnet@lostlap Desktop]$ sudo conary update Nitrogen

After your first login, you’ll need to add a menu entry using obmenu to call the nitrogen browser. So create the menu entry and the action you call is:

nitrogen /home/username/Photos/wallpaper

Of course, replace ‘username’ with your users name.  This will allow you to open up all the wallpaper photos inside of that directory.

So What Have we Done?

Today, we’ve installed Openbox on Foresight Linux. We’ve given it a tint2 panel so we have a place to dock applications and we’ve customized the Openbox right click menu and added a wallpaper program called Nitrogen. Hopefully, this shows you the customizable features of Openbox and also shows you the speed that Openbox operates at. It’s a very minimalistic environment, yet one that can be very powerful.

Installation Notes of Interest

tint2

Tint2 is my newly crowned favorite panel for openbox.  It’s lightweight and is able to be configured in so many ways.  I added the sleep command inside my autostart.sh to make sure that the desktop is loaded before the tint2 panel tries to load…mostly, this is due to network manager wanting to animate while the panel loads.  This isn’t as much problem with tint2 as it is with pypanel (see below).

pypanel

Some things I’ve noticed when running openbox…network manager has problems with pypanel. I added the sleep command inside my autostart.sh and this is much better now…but there may be similar problems with network manager. It’s really NM searching for a network and it causes the panel to flicker a bit. Not a real show stopper.

Gnome-panel

Gnome-panel running inside openbox causes a few errors to pop up when I login. This could be due to the fact that I’ve started things in my autostart.sh out of order…I’m also not all together sure what is causing these errors. The problem seems to be with the docking area of gnome-panel as when I minimize programs they are not docked. Easily fixable, but annoying nonetheless.

Alternative Panels

There are quite a few alternative panels out there.  Fbpanel is one.  Perlpanel is another.  Fbpanel and lxpanel are available in the Foresight repositories. You can also add other launchers like wbar if you so desire.

Screenshot

Openbox on Foresight

Openbox on Foresight

KDE and Xorg, Fonts and DPI



Today, I’d like to share a tip I found out while working with a beta release for a distirbution of Linux with KDE’s 3.5.7 version. As many readers of this blog know, I use PCLinuxOS 2007 as my main desktop and have done so since about 2005. The font configuration in PCLinuxOS is quite nice. I have a 19 inch LCD Monitor at home with 1280×1024 resolution. I notice no problems with the font on that monitor.

Working on a separate 20 inch monitor with a distribution in development however is another story. The fonts didn’t look beautiful at all. After some installation of custom fonts, things looked better, but the resolution is a bit higher on this LCD at 1400×1050. Easy to fix right? Just increase the DPI in the KDE Control Center to 120 right? Not so fast…even when it’s set to 96×96 there, it isn’t always set to 96×96. So let’s take a look at how you can force KDE to run at the correct DPI for your monitor which will, in turn, make your fonts look MUCH better. For those of you who are satisfied with your fonts, you might want to check out the commands below to see if you’re running at the DPI you think you are.

Read more

KDE Shortcut Keys

Most people know shortcuts in Windows but neglect to find out shortcuts in KDE when they make the switch to Linux. So, if you have a shortcut in KDE that isn’t covered here…please comment it so that others can benefit from your knowledge! PS: Some of these might not work with your version of KDE…just test them out and see if they do!

Alt-F2
Brings up a “Run Command” prompt

Alt-Print and Cntrl-Print
Take a screenshot. You have to paste it from your clipboard

Alt-Esc or Control-Esc
Shows the KDE session manager, from which you can switch to a specific application or log out of KDE.

Ctrl-F[1..8]
Switch to a specific desktop.

Alt-Tab or Alt-Shift-Tab
Cycle through your windows.

Ctrl-Tab or Ctrl-Shift-Tab
Cycle through your desktops.

Alt-F4
Close the current active window.

Ctrl-Alt-Esc
Window destroyer (every window you click on will be destroyed).

Alt-F3
For your Window Menu

Ctrl-Alt-Backspace
This exits KDE but doesn’t save your settings or work.

Ctrl-Alt-Numpad +
Cycles to the next screen resolution available.

Ctrl-Alt-Numpad –
Cycles to the previous screen resolution available.

Hope these help you out…please post any you might have that are helpful and I’ll add them to the list with credits. Thanks again for reading.

Schedule Tasks in Linux with Ease – Kcron

When I first started using Linux, one of the most daunting tasks was creating crontabs to automate processes. For example, one might want to rotate apache logs (done automatically now by most distros) or perhaps pull info out of those logs, paste them to a file, and send said file to the webmaster. Now this wouldn’t be feasible to do by hand daily and that is where crontabs come in. Just like scheduled tasks in Windows, crontabs allow you to run a process at a given time. Unlike Windows though, you have ultimate control over the task. Nowadays, things are much easier by using a GUI such as Webmin, pycron, or Crontooie (if you’re a MAC user). The great thing is that KDE contains a handy tool to create and manage your Crontabs. You can disable or enable them straight from an easy to understand and control GUI. Today, we’re going to take a look at how to setup a simple crontab using Kcron.

Let’s start off by seeing if the cron daemon is even running on your system. Open up a Konsole or Shell and type the following:

ps aux | grep crond

If there is output similar to that in the screenshot, we’re in business because the cron daemon is running. If not, restart cron by typing: ./usr/sbin/crond (may vary by your distro…if you need help, let me know in comments section).

Read more

Go to File >> Save and now you're in business. Never forget to save AFTER you've altered the task, otherwise your changes will go right out the window.

Make Klipper Work FOR you

“Klipper is the KDE clipboard utility. It stores clipboard history, and allows you to link clipboard contents to application actions.” That’s the common explanation you get from most people and online manuals when seeking information about Klipper. But what else can Klipper do? Is that ALL it does? Can we empower it to be what cut and past is in Windows? (ducks the possible flames) Perhaps. Grab a pen and paper Klip…let’s see what this thing can do. Please note that this article is written with the assumption that you are using KDE 3.4 or higher.

In most KDE default KDE desktops on the major distros, you find this little icon:

That icon is Klipper, your clipboard tool. A clipboard is just what it sounds like…a place where you can clip text to be used at a later date. I wanted to take a look at where Klipper came from…so I went into the ‘about Klipper’ menu and emailed a couple of developers. A few actually responded quelling the myth that developers are unreachable by the general public. Carsten Pfeiffer, a previous developer, responded about the history of Klipper:

“It was started long time ago by Andrew Stanley-Jones, for storing a history of clipboard entries. I took over maintainership and added those annoying popups, that appeared, for example when you selected a URL in a terminal or somewhere else. The popup allowed you to do something with the URL, like opening it in Konqueror or Mozilla.

More generally speaking, the feature allowed you to configure custom “actions” to execute when something specific, described with a regular expression was put into the clipboard (see klipper’s Preferences dialog).

Later, I attempted to make klipper hide X11’s IMNSHO broken concept of “Selection” and “Clipboard”, but I didn’t really accomplish that.

Later, Lubos Lunak worked hard on fixing Qt’s clipboard implementation and making klipper play well with it and now I’m very happy that Esben is taking care of it.”

I contacted Esben in an attempt to get some inside information about where Klipper might go in the future (integration into KDE-core perhaps? or other such directions). He was able to provide a few possible directions Klipper may go:

“My vision of Klipper is mostly as a clipboard history application… the actions I merely maintain for those that uses them. Thus the features I have implemented so far has centered on the history: Expanding the history (really making the history scalable), support for images (this was sort of a test, I want to support abitrary mime types in history) and search-as-you type support.”

Read more

Updates on Kapps

A thousand apologies for not updating my Kwhat? category. I’ve had to shuffle things around quite a bit here at the house (computer-wise) and am now the proud owner of a Slackware 10.X server running on a PII 350Mhz with 512MB of PC100! I had a RAM slot in my server mobo go bad so I was down for a few days while I moved motherboards from case to case. Back up now, but had to reinstall my favorite desktop distro in order to get back into the KWhat? mood.

Not to mention I’ve worked 50+ hours in the past two weeks on big projects. So, now that I have time to breath this weekend…I’ll look to finally getting into the Kswing of things. I hope to cover something I find handy like Kid3, KCheckGmail, and KLinkStatus along side of something that comes installed by default like Klipper (something that most of us see but never use even though it is a powerful little tool). So look for something to pop up this weekend and once again, sorry to those of you who were waiting for me to get my rear end in gear and publish something.

UPDATE: I’ve had some last minute contact with developers and am trying to incorporate this into the article. Please look for this to publish Wednesday or Thursday. I’ve selected Klipper as the KWhat? application we’ll be looking at.