Fluxbox on Ubuntu beginners guide

Fluxbox is a window manager for X. It’s based on Blackbox but has much more to offer.

Fluxbox is a very lightweight window manager.

updated 03/08/08

This “guide” is meant for people who already have Ubuntu installed. Not for people with a server install.

It’s aimed at people new to Fluxbox and is meant to help them getting started.

Before you think about installing it beware Fluxbox isn’t exactly the most user friendly wm. So if you are having trouble with xfce/gnome/kde this won’t be for you.

On the other hand, if you are bored with those, by all means try Fluxbox.

1. Installation
2. Start Fluxbox
3. Usage
4. Shortcuts
5. Visual improvement

6. Editing the startup file
7. Editing the menu
8. Setting your own icons
9. Select your keyboard layout

1. Installation

Open up your favorite cli client and use apt to install it for you.

sudo apt-get install fluxbox

2. Start Fluxbox

Log out and start Fluxbox (press the “session” button).

3. Usage

You open up the menu by right-clicking the background.

The menu will be made automatically when you installed it, so all your programs should be in there under “applications” and the various sub menu’s.

Have a look around.

You can’t display icons on the desktop. However there are ways around that.

4. Shortcuts

The config file for shortcuts is in /home/username/.fluxbox/keys .

Open it.

You should already see some shortcut, so learn them or modify them to your liking.

Before you start adding new ones, you’ll need to know this:
Mod1 == Alt
Mod4 == Windows key
Control == Ctrl
Shift == Shift

So a short cut for “alt+f1″ would be “Mod1 F1″.

Besides those keys, the rest is as you would expect.

I find it easy to assign programs to the function keys.

Because I do so, I hardly ever need to use the right-click menu and it saves me a lot of time.

This is my keys file:

OnDesktop Mouse1 :HideMenus
OnDesktop Mouse2 :WorkspaceMenu
OnDesktop Mouse3 :RootMenu
OnDesktop Mouse4 :NextWorkspace
OnDesktop Mouse5 :PrevWorkspace
Mouse8 :NextWorkspace # top side button mouse -> next workspace
Mouse9 :PrevWorkspace # bottom side button mouse -> prev workspace

Mod1 Tab :NextWindow
Mod1 Shift Tab :PrevWindow

# Launch programs

F12 :ExecCommand xterm # opens a cli client
F11 :ExecCommand firefox # opens the firefox webbrowser client
F10 :ExecCommand thunar # opens the thunar file manager
F9 :ExecCommand mousepad # opens the mousepad text editor
F8 :ExecCommand sonata # opens the sonata music player
Mod1 F2 :Exec fbrun # opens a “run” dialog window, similar to “alt+f2″ in gnome

# Media keys

#    System Volume
F2 :Exec amixer sset Master,0 5%- # raise volume by 5%
F3 :Exec amixer sset Master,0 5%+ # lower volume by 5%
F4 :Exec amixer sset Master,0 toggle # mute volume

#    MPC (music player command for music player deamon)
F6 :Exec mpc next # plays next song in playlist
F5 :Exec mpc prev # plays previous songs in playlist
F7 :Exec mpc toggle # pauses or play the song

# Visual

F1 :ToggleDecor # removes or adds window decoration

# Screen shot:

Control F12 :Exec scrot -e ‘mv $f ~/Desktop’ # takes a screen shot of the entire screen

(Exec or ExecCommand is the same)

If you wish to start nautilus, it will take over your desktop and Fluxbox will be useless. So you need to start it with “nautilus –no-desktop”. Note that “–” = “- -” without the ” “.

Looking for more advanced keyboard shortcuts?

5. Visual improvement

5.1 Styles

There are a few decent Fluxbox styles (right-click -> styles to choose them) but there are much better ones online.

A simple google search will tell you a lot, but I found http://customize.org/fluxbox to be one of the better ones.

After you downloaded the .tar.gz extract it to /home/username/.fluxbox/styles .

After that the style will be available through the menu.

5.2 Gtk themes

Most if not all of the apps will use the default ugly grey nautilus colour (the one I reffer to as the win95 theme) and that isn’t real nice to look at.

There is a nice little program available that will let you set gtk themes for your apps.

sudo apt-get install  gtk-chtheme

Open it using a terminal and you’ll be able to pick the gtk themes you installed in /home/username/.themes .

The gtk-chtheme app will even preview the theme for you.

5.3 Wallpaper

You must have noticed that either you didn’t have a wallpaper or couldn’t change the one your theme set for you.

Use this command to set the wallpaper.

fbsetbg -f /path/to/image.png

5.4 Conky

If conky fits anywhere, it’s on a fluxbox box.

Installations notes

Editing the startup file

You can add programs/commands in this line to execute at startup.

The text we need is located in /home/user/.fluxbox/startup

It’s really easy to modify.

The default file looks something like this:

# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.

# You can set your favourite wallpaper here if you don't want
# to do it from your style.
#
# fbsetbg -f ~/pictures/wallpaper.png
#
# This sets a black background

/usr/local/bin/fbsetroot -solid black

# This shows the fluxbox-splash-screen
# fbsetbg -C /usr/local/share/fluxbox/splash.jpg

# Other examples. Check man xset for details.
#
# Turn off beeps:
# xset -b
#
# Increase the keyboard repeat-rate:
# xset r rate 195 35
#
# Your own fonts-dir:
# xset +fp $HOME/.font
#
# Your favourite mouse cursor:
# xsetroot -cursor_name right_ptr
#
# Change your keymap:
# xmodmap ~/.Xmodmap

# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN & AT THE END.
#
# unclutter -idle 2 &
# wmnd &
# wmsmixer -w &
# idesk &

# And last but not least we start fluxbox.
# Because it is the last app you have to run it with exec before it.

exec /usr/local/bin/fluxbox
# or if you want to keep a log:

dsf
# exec /usr/local/bin/fluxbox -log ~/.fluxbox/log

Let’s say you want your wallpaper to be there when you start up your pc instead of having to type the command.

Look for the

# fbsetbg -f ~/pictures/wallpaper.png

line and remove the “#” in front of it. Then adjust the path to point to the actual wallpaper.

Note that in Ubuntu ~/pictures/wallpaper.png won’t work. Everything in linux in case sensitive so it has to be ~/Pictures/wallpaper.png

Or lets say you want to add conky.

Look for this block of text

# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN & AT THE END.
#
# unclutter -idle 2 &
# wmnd &
# wmsmixer -w &
# idesk &

And add “conky &” to the bottom without an “#”.

Mine looks like this:

# fluxbox startup-script:
#
# Lines starting with a ‘#’ are ignored.

# You can set your favourite wallpaper here if you don’t want
# to do it from your style.
#
fbsetbg -f /home/rw/Pictures/wall.jpg
#
# This sets a black background

#/usr/bin/fbsetroot -solid black

# This shows the fluxbox-splash-screen
fbsetbg -C /usr/share/fluxbox/splash.jpg

# Other examples. Check man xset for details.
#
# Turn off beeps:
# xset -b
#
# Increase the keyboard repeat-rate:
# xset r rate 195 35
#
# Your own fonts-dir:
# xset +fp “/home/rw/.fonts”
#
# Your favourite mouse cursor:
# xsetroot -cursor_name right_ptr
#
# Change your keymap:
# xmodmap “/home/rw/.Xmodmap”

# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ”&” AT THE END.
#
# unclutter -idle 2 &
# wmnd &
# wmsmixer -w &
# idesk &
conky &
mpd &
mediatomb &

# And last but not least we start fluxbox.
# Because it is the last app you have to run it with ”exec” before it.

exec /usr/bin/fluxbox
# or if you want to keep a log:
# exec /usr/bin/fluxbox -log “/home/rw/.fluxbox/log”

7. Editing the menu

Because the menu is automatically generated by ubuntu, you’ll see that /home/username/.fluxbox/menu points to /etc/X11/fluxbox/fluxbox-menu .

So let’s copy the content of that last file to /home/username/.fluxbox/menu .

The file is easy once you know what to do.

It basically goes like this:

[begin] (Fluxbox)
[exec] (xterm) {xterm}
[separator]
[submenu] (Tools)
[exec] (Galculator) {galculator}
[exec] (Gnome Commander) {gnome-commander}
[exec] (File Roller) {file-roller}
[exec] (K3B) {k3b}
[exec] (Gramps) {gramps}
[end]

[submenu] (fluxbox menu)
[config] (Configure)
[submenu] (Styles) {Choose a Style…}
[stylesdir] (/usr/X11R6/share/fluxbox/styles)
[end]
[workspaces] (Workspace List)
[submenu] (Tools)
[exec] (Window name) {xprop WM_CLASS|cut -d \” -f 2|xmessage -file – -center}
[end]
[commanddialog] (Fluxbox Command)
[reconfig] (Reload config)
[restart] (Restart Fluxbox)
[exec] (About) {fluxbox -v 2>/dev/null | head -n1 | xmessage -file – -center}
[exit] (Exit Fluxbox)
[separator]
[exec] (Reboot) {shutdown -r now}
[exec] (Shutdown) {shutdown -p now}
[end]
[end]

You always start with

[begin] (Fluxbox)

[end]

Everything else goes in there. Kind of like the <html> </html> tags for those familiar with html.

If you want to list a program in the main menu, you use this code:

[exec] (xterm) {xterm}

Where (xterm) is the word that will appear in the menu and {xterm} the command to launch the app.

If you want a little seperator, use this

[separator]

Most likely you’ll want sub-menu’s.

You use

[submenu] (name you come up with)

[end]

So between those two, you can use the [exec] to list applications or open another submenu.

The second part of text in the example, is the fluxbox menu.

I didn’t touch it, but you could throw some things around in there if you like.

Mine looks like this:

[begin] (Fluxbox)
[exec] (Xterm) {xterm}
[separator]
[submenu] (Tools)
[exec] (File Roller) {file-roller}
[exec] (Feh Image Viewer) {feh}
[exec] (Synaptic) {gksu synaptic}
[end]
[submenu] (Internet)
[exec] (Firefox) {firefox}
[exec] (Emesene) {emesene}
[exec] (Transmission) {transmission}
[exec] (Xchat) {xchat}
[exec] (Frostwire) {frostwire}
[exec] (Nicotine Plus) {nicotine}
[end]
[submenu] (Editors)
[exec] (Mousepad) {mousepad}
[exec] (Abiword) {abiword}
[exec] (Gnumeric) {gnumeric}
[end]
[submenu] (Multimedia)
[exec] (VLC Media Player) {vlc}
[exec] (Sonata) {sonata}
[exec] (Brasero) {brasero}
[exec] (Audio Tag Tool) {tagtool}
[exec] (Avidemux) {avidemux}
[end]
[submenu] (Graphics)
[exec] (Gimp) {gimp}
[exec] (Xpdf) {xpdf}
[end]
[separator]
[submenu] (Fluxbox Menu)
[config] (Configure)
[submenu] (Styles) {Choose a Style…}
[stylesdir] (/usr/X11R6/share/fluxbox/styles)
[end]
[workspaces] (Workspace List)
[submenu] (Tools)
[exec] (Window name) {xprop WM_CLASS|cut -d \” -f 2|xmessage -file – -center}
[end]
[commanddialog] (Fluxbox Command)
[reconfig] (Reload config)
[restart] (Restart Fluxbox)
[exec] (About) {fluxbox -v 2>/dev/null | head -n1 | xmessage -file – -center}
[exit] (Exit Fluxbox)
[separator]
[exec] (Reboot) {shutdown -r now}
[exec] (Shutdown) {shutdown -p now}
[end]
[end]

It’s nice and simple.

(watch first screenshot to view menu)

Set your own icons

Open up /home/username/.gtkrc-2.0 and add this line to it

gtk-icon-theme-name = “ALLBLACK”

ALLBLACK is the name of the folder containing my icon set in /home/username/.icons .

So just put the name of the theme you extracted there instead of ALLBLACK.

Note you can also set your gtk theme like that instead of using the app.

Use

gtk-theme-name = “NovaBlue”

for that, where NovaBlue would be the name of the folder containing your gtk theme in /home/username/.themes .

9. Select your keyboard layout

You will have to edit your xorg.conf file. Use this command to do so:

sudo mousepad /etc/X11/xorg.conf

(presuming you use mousepad, if not change to the editor of your liking)

In the first block of text you’ll see:

Section “InputDevice”
Identifier “Generic Keyboard”
Driver “kbd”
Option “XkbRules” “xorg”
Option “XkbModel” “pc105″
Option “XkbLayout” “be”

You would change the last one to the keyboard layout you would like.

Mine is now “be” (azerty), so change that to yours.

You can put more that one.

You could set

Option “XkbLayout” “be,us”

You could then switch between layouts by using the command

Code:

setxkbmap be

or

Code:

setxkbmap us

The first command would set your keyboard layout to azerty (be), the second one to qwerty (us).

Now, you could add those commands to your menu by editing your menu file.

Code:

sudo mousepad /home/username/.fluxbox/menu

You would use the following to add those:

[exec] (azerty) {setxkbmap be}
[exec] (qwerty) {setxkbmap us}

But it would be best to add a submenu for changing keyboard layouts.

[submenu] (Layouts)
[exec] (azerty) {setxkbmap be}
[exec] (qwerty) {setxkbmap en}
[end]

Then when you right-click your desktop, a mentioning of “Layouts” will be there, with the options to load the “azerty” or “qwerty” keyboard layouts.

Hope this helped.
————————–

————————–

That’s it for now. I’ll be adding things in the near future.

If you have suggestions or other tips, feel free to share them with me in the comments.

About these ads
    • Lao Tzu
    • July 24th, 2008

    Thanks. I am getting ready to install unbuntu, and this looks like it might be helpful.

  1. Great guide. Your keys file is kind of lacking. This is mine.
    —————————————-
    OnDesktop Mouse1 :HideMenus
    OnDesktop Mouse2 :WorkspaceMenu
    OnDesktop Mouse3 :RootMenu
    OnDesktop Mouse4 :NextWorkspace
    OnDesktop Mouse5 :PrevWorkspace

    Mod1 Tab :NextWindow
    Mod1 Shift Tab :PrevWindow
    Mod1 F1 :Workspace 1
    Mod1 F2 :Workspace 2
    Mod1 F3 :Workspace 3
    Mod1 F4 :Workspace 4
    Mod1 F5 :Workspace 5
    Mod1 F6 :Workspace 6
    Mod1 F7 :Workspace 7
    Mod1 F8 :Workspace 8
    Mod1 F9 :Workspace 9
    Mod1 F10 :Workspace 10
    Mod1 F11 :Workspace 11
    Mod1 F12 :Workspace 12

    #Run Command
    Mod4 r :exec fbrun

    #Run Programs
    Mod4 i :exec firefox
    Mod4 p :exec pencil
    Mod4 j :exec geany
    Mod4 w :exec abiword
    Mod4 m :exec audacious
    Mod4 g :exec gimp
    Mod4 b :exec blender
    Mod4 v :exec vlc
    Mod4 t :exec xterm
    Mod4 f :exec rox-filer

    #Window Control
    Mod1 m :Maximize
    Mod1 n :Minimize
    Mod1 c :Close

    #Fluxbox
    Mod1 j :RootMenu

    Mod1 1 :SendToWorkspace 1
    Mod1 2 :SendToWorkspace 2
    Mod1 3 :SendToWorkspace 3
    Mod1 4 :SendToWorkspace 4

    Mod1 z :PrevWorkspace
    Mod1 x :NextWorkspace

    #Volume
    Mod4 0 :exec aumix -v +5
    Mod4 9 :exec aumix -v -5

    —————————————

    I still have stuff to add to it, but that covers it. I am not telling you you are wrong, I’m just really like using the keyboard to do stuff.

    • linuxowns
    • July 25th, 2008

    Thanks, I’ll borrow some of your shortcuts.

    • harls
    • September 8th, 2008

    Hi,
    Good tutorial. I’m a Slackware user who recently decided to give Ubuntu a try. My menu file keeps the:
    [include] (/etc/X11/fluxbox/fluxbox-menu)
    command in there after some of my commonly used programs so that when I use the package manager to install new stuff it automatically updates the menu.
    Thanks for the tutorial!

    • linuxowns
    • September 8th, 2008

    You’re welcome.

    • k0r
    • September 13th, 2008

    what are your conky settings in that screenshot?

    • linuxowns
    • September 13th, 2008

    I no longer use that conky file and didn’t save it.

    • grey
    • December 3rd, 2008

    how can i change the panel ?

    i want to use tint2…

  2. I admire people who are so techy and creative, not to mention being patient in doing this kind of stuff. I’m a novice to this wallpaper designs but I sure would love to learn how someday. For now, searching for Free Desktop Wallpaper online is what I do best.

  3. Hi there, You have done an incredible job. I’ll definitely digg it and personally recommend to my friends. I am confident they will be benefited from this website.

  4. Remarkable! Its in fact amazing paragraph, I have got much clear idea about from this post.

  5. Sweet blog! I found it while surfing around on Yahoo
    News. Do you have any tips on how to get listed in Yahoo News?

    I’ve been trying for a while but I never seem to get there! Thank you

  6. Greetings from Florida! I’m bored to death at work so I decided to check out your site on my iphone during lunch break. I love the information you present here and can’t
    wait to take a look when I get home. I’m surprised at how quick your blog loaded on my cell phone .. I’m not even using
    WIFI, just 3G .. Anyhow, excellent site!

  7. My family all the time say that I am killing my
    time here at web, except I know I am getting knowledge daily by reading such good content.

  1. August 17th, 2008
  2. July 2nd, 2011

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 58 other followers

%d bloggers like this: