Showing posts with label fluxbox. Show all posts
Showing posts with label fluxbox. Show all posts

Friday, September 14, 2007

Ubuntu Server on Pentium II


For a Pentium II machine I recently revitalized, I wanted to install only the most essential software, so I started from the Ubuntu Server 6.06.1 CD. I did an expert install, since this particular motherboard, an Elitegroup (ECS) P6BX-A+ with Award BIOS, doesn't play nice with GRUB. Plus I planned on some little tweaks, like setting a static IP from the get-go and making a more server-like partitioning scheme.

NOTE: Unless you specify otherwise via the expert installer, Ubuntu disables login as root.

After completing the base installation, during which I opted to use all available repositories, I updated the package indices and installed the necessary packages for X, plus a window manager and other conveniences.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install x-window-system-core xdm fluxbox xterm
Then I rebooted and was delighted to find the X server started without a single problem.

While installing additional packages, I discovered that it took an intolerably long time to connect to the repositories. Once I installed Firefox, I observed similar delays in loading pages. For some reason, disabling IPv6 (via about:config) got Firefox working, but apt-get remained sluggish. So I used traceroute in the hope of finding the cause.

Apart from the delay in passing through the gateway, which I also observed on my Debian box when I traced the same route for comparison, it wasn't resolving domain names. Instead of the expected output,
traceroute to us.archive.ubuntu.com (91.189.89.8), 30 hops max, 40 byte packets
1 192.168.1.1 (192.168.1.1) 1.931 ms 1.680 ms 1.782 ms
2 * * *
3 XX-N-N-XXNN.XXXXXXX.pa.panjde.comcast.net (NN.NN.NNN.NN) 8.599 ms 7.877 ms 9.530 ms
4 XX-NN-XXNN.XXXXXXX.pa.panjde.comcast.net (NN.NN.NNN.NNN) 9.573 ms 8.122 ms 9.572 ms
5 XX-NN-XXNN.XXXXXXXX.de.panjde.comcast.net (NN.NN.NNN.NNN) 10.248 ms 8.929 ms 9.522 ms
6 po-10-ur01.norristown.pa.panjde.comcast.net (68.86.209.98) 10.724 ms 9.759 ms 9.519 ms
7 po-10-ur02.norristown.pa.panjde.comcast.net (68.86.209.102) 9.838 ms 10.222 ms 9.526 ms
8 po-21-ar01.wallingford.pa.panjde.comcast.net (68.86.209.106) 12.028 ms 11.325 ms 11.952 ms
9 68.86.91.182 (68.86.91.182) 14.310 ms 14.387 ms 14.187 ms
10 68.86.85.2 (68.86.85.2) 13.551 ms 13.315 ms 14.142 ms
11 68.86.84.153 (68.86.84.153) 17.783 ms 16.573 ms 17.901 ms
12 te-1-3-pr01.ashburn.va.ibone.comcast.net (68.86.84.154) 18.032 ms 16.492 ms 16.894 ms
13 xe-3-1-0.was11.ip.tiscali.net (213.200.84.117) 16.672 ms 17.544 ms 16.504 ms
14 so-6-1-0.lon11.ip.tiscali.net (213.200.80.26) 94.043 ms 93.927 ms 93.544 ms
15 01502-004-01-gw.ip.tiscali.net (213.200.77.114) 93.777 ms 93.384 ms 93.506 ms
16 195.72.129.70 (195.72.129.70) 92.104 ms 90.699 ms 91.123 ms
17 byrd.canonical.com (91.189.88.11) 93.688 ms 93.222 ms 94.142 ms
18 * * *
every line looked like lines 9-11 above: no FQDN, only an IP. That pointed to a DNS problem. So I opened resolv.conf and found that the resolver had been using my router as its name server—a less than ideal configuration, since my router is an entry-level Linksys. I merely changed resolv.conf to read
search hsd1.pa.comcast.net.
nameserver 68.87.75.194
nameserver 68.87.64.146
and restarted networking services:
sudo /etc/init.d/networking restart
and it worked flawlessly.

The server install achieved exactly what I envisioned for this box: low resource usage. Here's the process tree right now, with one user active.
init─┬─atd
├─cron
├─cupsd
├─dd
├─events/0
├─6*[getty]
├─khelper
├─5*[kjournald]
├─klogd
├─ksoftirqd/0
├─kswapd0
├─kthread─┬─aio/0
│ ├─kacpid
│ ├─kblockd/0
│ ├─kgameportd
│ ├─khubd
│ ├─kseriod
│ └─2*[pdflush]
├─mdadm
├─migration/0
├─shpchpd_event
├─sshd───sshd───sshd───bash─┬─firefox-bin───2*[{firefox-bin}]
│ └─pstree
├─syslogd
├─udevd
├─watchdog/0
└─xdm─┬─Xorg
└─xdm
Yes, I'm writing this post in Firefox on the Ubuntu server with X forwarding to my laptop. Remember, this is a Pentium II at 450MHz, circa 1998. Legacy hardware has a place in modern computing—in the third bedroom, right beside my main Debian box.

Friday, August 17, 2007

The Slit

Fluxbox has something called the slit. It's like the Windows Vista Sidebar—except n times better because you're not running Windows Vista. In short, it gives you convenient access to "dockable" applications in the form of a sidebar on your desktop.

For example, GKrellM can be run with the "withdrawn" option and will then appear in the slit. It provides an easily customized set of system monitors, so you can keep an eye on your box's vital signs. If you don't have it already, it's no problem to install.

apt-get install gkrellm
gkrellm -w


I know no one's working on the original XMMS project anymore, but I still use it. It can also be docked in the slit. Just run wmxmms & and it should appear there.

The Fluxbox FAQ suggests that you can use wmDrawer to display the Fluxbox logo in the slit. Of course, you could use the same method to display any other image. The FAQ doesn't go into the specifics, but it's simple.

First we install it. I also chose to copy the example resource file to my home directory.

apt-get install wmdrawer
cp /usr/share/doc/wmdrawer/wmdrawerrc.example ~


Then I copied the Fluxbox logo to the directory where wmDrawer looks for images.

cp fb-icon48x48-metal.png /usr/share/pixmaps

The example file also has a line for /usr/local/share/pixmaps, which I ignored because that path doesn't exist on my system. I edited the file to use the logo as its dock icon and commented out the lines defining the buttons, since I don't use them. When I was done, the file looked like this:
# Config file example for wmdrawer
[general]
# Dock's icon [optional]
dock_icon fb-icon48x48-metal.png

# Drawer's opening direction [required]
# Top to bottom = 0
# Right to Left = 1
# Bottom to Top = 2
# Left to Right = 3
direction 2

# Image used for icons' background [optional]
#icons_bg defaultTile.xpm

# Allow icons' enlargement to fit them to buttons' size [optional, default 1]
# 0 indicate that icons should never be larger than their original size.
#icons_expand 1

# Activate the drawer's pseudo-transparency [optional, default 0]
# if you choose transparency, icons_bg will be ignored
#transparency 0

# dock's width: min=12, max=128 [optional, default=64]
#dock_width 64

# dock's height: min=12, max=128 [optional, default=64]
#dock_height 64

# buttons' size: min=12, max=128 [optional]
# Useful for the people who want for example to have big icons
# and to define several columns.
#btns_size 32

# Icon's highlight type: 0, 1 or 2 [optional, default 2]
# 0 : no highlight
# 1 : target (unavailable if transparency is activated)
# 2 : shading
#highlight 2

# Image used as highlight [optional]
# only used if you choice target type
#highlight_img highlight.xpm

# Tint icons by a specified color [optional, default #ffffff]
# only used if you choice shading type
#highlight_tint #ffffff

# Shade icons at a specified level [optional, default 60]
# only used if you choice shading type
#highlight_sh 60

# Display buttons' tooltips [optional, default 1]
#tooltips 1

# Tooltips' font [optional, default fixed]
#tooltips_font fixed

# Drawer's animation speed: 0, 1, 2, 3, 4 [optional, default 1]
#animation_speed 1

# Mouse cursor in drawer: 0, 1, ..., 76 [optional, default 30]
#cursor 30

# Auto opening of the drawer: 0, 1 [optional, default 0]
#show_on_hover 0

# Auto closing of the drawer: 0, 1 [optional, default 0]
#hide_on_out 0

# drawer's hiding timeout in miliseconds [optional, default 1000]
#hide_timeout 1000

# Runs the dockapp in windowed mode: 0, 1 [optional, default 0]
# Useful for AfterStep, Fvwm, Sawfish or KDE users.
#windowed_mode 0

# Instance name so window manager can distinguish between multiple copies
#instance_name distinguish_name

# Drawer's border size in pixels [optional, default 1]
#border_size 1

# Images directories
[images_paths]
/usr/share/pixmaps
/usr/local/share/pixmaps/

# A first column with 5 buttons
# Each button must be defined with this syntax:
# (tooltip) (image) (command)
#[column]
#(X Terminal) (gnome-term.png) (xterm -bg black -fg wheat)
#(Galeon) (galeon.xpm) (galeon -s)
#(Sylpheed) (sylpheed.png) (sylpheed)
#(XChat) (xchat.png) (xchat)
#(MPlayer) (gnome-multimedia.png) (mplayer)

# A second column with 5 buttons
#[column]
#(Xmms) (gnome-audio2.png) (xmms)
#(Gimp) (gnome-gimp.png) (gimp)
#(GQview) (gqview.png) (gqview)
#(Xcalc) (gnome-calc3.png) (xcalc)
#(GFtp) (gftp.png) (gftp)
The lines I changed are boldfaced. Although it serves a purely cosmetic purpose on my desktop, wmDrawer has many other capabilities. Its documentation can tell you more.

Once you've arranged your slit apps to your satisfaction, right-click on the slit. You may need to try clicking in a few different places before you get the slit menu instead of the menu of a slit app. Select the "save slit list" item. Now the next time you restart Fluxbox, all your favorite dockable applications will be at your fingertips.

EDIT: Okay, it took me over a month to realize I omitted some important info here. In order to have your apps run in the slit when you start a Fluxbox session, you must add them to the ~/.fluxbox/startup script. There are plenty of comments in the default script to guide you.

Sunday, August 05, 2007

Fluxbox Keys

Over the past several months, I've come to appreciate KDE applications—especially Amarok, Kaffeine and Konqueror. Unfortunately, KDE eats RAM like Cookie Monster once ate cookies. (Those were the days.) So I went back to Fluxbox.

One of my biggest frustrations with Fluxbox used to be the keybindings. The default keyboard shortcuts aren't much like the ones I know from GNOME and KDE. I would often hit Alt+F4, expecting the window to close, and instead get switched to Workspace 4. Then I discovered how easy they are to customize.

The first time you log into a Fluxbox session, it creates a directory ~/.fluxbox where it stores a small handful of config files. Among them is the keys file. All you have to do is remove the bindings you don't want and replace them with your preferred set. Here's mine:

Control F1 :Workspace 1
Control F2 :Workspace 2
Control F3 :Workspace 3
Control F4 :Workspace 4
Control Mod1 Escape :KillWindow
Mod1 F1 :RootMenu
Mod1 F2 :ExecCommand fbrun
Mod1 F4 :Close
Mod1 F9 :Minimize
Mod1 F10 :MaximizeWindow
Mod1 Shift Tab :PrevWindow
Mod1 Tab :NextWindow


I struck a compromise between the GNOME and KDE defaults. Note that Mod1 is the Alt key.

So, for example, I can press Alt+F2 and get what amounts to a "Run…" dialog. Then I enter a command, like xterm, and I'm on my way. It's an particularly handy binding for those who avoid the mouse whenever possible.

More detailed info can be found in the Fluxbox Keybindings section of the docs.

Friday, January 20, 2006

Brown paper Fluxboxes tied up with string

Fluxbox is a window manager for X. Its chief advantage over Metacity—the window manager with which you'll be familiar if you use GNOME—is its streamlined design; it runs much faster. For this reason, distros like DSL use it as their default window manager. It can also be customized by editing a few text files. Users often set up impressive Fluxbox themes (see below). Unfortunately it didn't "just work" on my Debian system.

Several FAQs on setting up Fluxbox mention an executable called fluxbox-generate_menu. When run, it's supposed to take an inventory of your applications and generate corresponding items in the Fluxbox menu, which initially lists nothing but a launcher for xterm and the options to restart Fluxbox or logout. It isn't the best tool; it tends to clutter your menu with items you never actually use and omit ones you do. But I consider it more efficient to run it and then adjust the menu accordingly, rather than track down every application and add them to ~/.fluxbox/menu. There was one problem: installing the fluxbox package didn't seem to install fluxbox-generate_menu as promised. I had to search for a while before I found the solution.

It's kind of dopey. Apparently there's a bug in the package, and consequently the archive containing fluxbox-generate_menu doesn't get decompressed and copied to /usr/bin during the installation. So we have to do it manually. It's not tough.

# cd /usr/share/doc/fluxbox
# gunzip fluxbox-generate_menu.gz
# cp fluxbox-generate_menu /usr/bin
# chmod a+x /usr/bin/fluxbox-generate_menu


Let's go line by line. The cd command changes your working directory. Then the gunzip command decompresses or "unzips" the archive. You could alternately use gzip -d here. We use the cp command to copy the executable to the appropriate directory. The chmod a+x command gives all users permission to run it; otherwise only the root user could. It can be used with other options for different effects.

These commands should all be run as the root user. You can become root by entering sudo su at the command line or by logging in with user name "root" and the root password (not your user password, which may be different).

I'm still having a problem with fluxbox-generate_menu, but that's a discussion for another day.