Results 1 to 9 of 9

Thread: Fluxbox beginners guide

  1. #1
    Join Date
    Jul 2007
    Location
    Brugge, België
    Beans
    2,933

    Fluxbox beginners guide

    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

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

    Code:
    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 revWorkspace
    Mouse8 :NextWorkspace # top side button mouse -> next workspace
    Mouse9 revWorkspace # bottom side button mouse -> prev workspace

    Mod1 Tab :NextWindow
    Mod1 Shift Tab revWindow

    # 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 use nautilus, use the "nautilus --no-desktop" command.

    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.

    Code:
    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.

    Code:
    fbsetbg -f /path/to/image.png
    5.4 Conky

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

    Installations notes.

    6. 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 separator, 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] (Mirage Image Viewer) {mirage}
    [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)

    8. 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:

    Code:
    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:

    Code:
    setxkbmap be
    or

    Code:

    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:

    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.

    ————————–





    ---------

    Guide taken from my Ubuntu blog http://linuxowns.wordpress.com
    Last edited by billgoldberg; August 3rd, 2008 at 08:07 PM.

  2. #2
    Join Date
    Dec 2007
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Fluxbox beginners guide

    Yay! Indeed nice tutorial for a beginner. Saved me a lot of time.
    Last edited by hanniph; August 18th, 2008 at 02:22 PM. Reason: mistyped

  3. #3
    Join Date
    Jul 2007
    Location
    Brugge, België
    Beans
    2,933

    Re: Fluxbox beginners guide

    Glad you liked it.

  4. #4
    Join Date
    May 2007
    Beans
    360
    Distro
    Xubuntu

    Re: Fluxbox beginners guide

    I haven't booted into Gnome once on my main PC thanks to you, billgoldberg.

  5. #5
    Join Date
    Apr 2005
    Location
    Davenport, IA
    Beans
    107
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Fluxbox beginners guide

    My problem is that when I press the right button on my mouse nothing happens. No menu, nothing. Any ideas?

  6. #6
    Join Date
    Aug 2007
    Location
    Sunny Bribane in Aus
    Beans
    672
    Distro
    Hardy Heron (Ubuntu Development)

    Re: Fluxbox beginners guide

    My problem is that when I press the right button on my mouse nothing happens. No menu, nothing. Any ideas?
    If that was your first time into fluxbox then ctrl+alt+bksp to logout and log back in and a menu should be there - else just copy the menu file above as a start

  7. #7
    Join Date
    Apr 2005
    Location
    Davenport, IA
    Beans
    107
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Fluxbox beginners guide

    I do not have a /etc/X11/fluxbox/fluxbox-menu file.

    I have the following files in /etc/X11/fluxbox:

    bob@bob-desktop:/etc/X11/fluxbox$ ls
    fluxbox.menu-user init keys system.fluxbox-menu

  8. #8
    Join Date
    Dec 2006
    Beans
    1,806

    Re: Fluxbox beginners guide

    Quote Originally Posted by bobterri View Post
    My problem is that when I press the right button on my mouse nothing happens. No menu, nothing. Any ideas?
    Have a look at the tutorial in my signature.

  9. #9
    Join Date
    Apr 2005
    Location
    Davenport, IA
    Beans
    107
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Fluxbox beginners guide

    Thanks, RedSquirrel. Your tutorial did the trick.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •