Fluxbox

De doc.ubuntu-es
Revisión a fecha de 00:10 14 jun 2008; Mstreet linux (Discusión | contribuciones)

(dif) ← Revisión anterior | Revisión actual (dif) | Revisión siguiente → (dif)
Saltar a: navegación, buscar
Fluxbox
Desarrollador:
Equipo de Fluxbox
Género:
Gestor de ventanas
Licencia:
libre (MIT)
En Español:
Sitio Web:
www.fluxbox.org

Fluxbox es un gestor de ventanas ligero y rápido para GNU/Linux. No es tan complejo como GNOME o KDE, pero consume muchos menos recursos del sistema. Esto lo hace ideal para situaciones en las que loss recursos, especialmente la RAM, están muy limitados. Se configura mediante simples ficheros de texto ubicados en el directorio personal del usuario.

Fluxbox es un gestor de ventanas rápido y ligero para el X Window System, basado y compatible con Blackbox. Su apariencia es similar a la de Blackbox, y maneja los estilos, colores, ubicación de las ventanas y cosas similares exactamente como Blackbox. Permite usar aplicaciones de cualquier entorno, tales como GNOME, KDE o Xfce. Sin embargo, no depende de ningún otro gestor de ventanas.

La interfaz básica sólo dispone de una barra de tareas y un menú accesible haciendo clic con el botón derecho en el escritorio. Fluxbox también admite atajos de teclado creados por el usuario.

Fluxbox tiene un mecanismo para agrupar las ventanas en pestañas. Puedes combinar múltiple ventanas en una sola, con pestañas alrededor del borde superior, simplemente manteniendo presionado el botón central en la pestaña de una ventana y arrastrándola hasta la de otra ventana. Esto es útil para mantener limpio el escritorio sin tener que organizar las ventanas en varios escritorios virtuales (aunque esto es posible también).

Otra característica destacable de Fluxbox es su soporte para docking applications (dockapps). Básicamente una dockapp es como una especie de ícono con una pantalla en miniatura o controles. Pero no como un ícono, más bien como pequeños controles de un walkman (por ejemplo) en contraste con los grandes controles de un home stereo. Pretende ser ligero y altamente personalizable, con compatibilidad mínima con íconos gráficos, y sólo capacidades de estilo para la interfaz básicas.

Siguiendo el objetivo de simplicidad de Fluxbox, el menú principal, los atajos de teclado y la configuración básica se cambian editando ficheros de texto. Los temas de Fluxbox son 100% compatibles con los de Blackbox. Se pueden configurar colores, gradientes, bordes, y varios atributos de apariencia básicos más; las versiones recientes permiten bordes redondeados y elementos gráficos. Fluxbox también tiene varias características de las que carece Blackbox, incluyendo ventanas en pestañas, una funcionalidad familiar de PWM, y barras de título configurables.

Contenido

¿Por qué usar Fluxbox?

Como se mencionó antes, Fluxbox funciona eficientemente en sistemas con muy pocos recursos. Por lo tanto, es ideal para usarlo en hardware antiguo (por esta razón es el gestor de ventana por defecto en la distribución bien llamada Damn Small Linux).

La estética minimalista de Fluxbox lo convierte en un entorno de trabajo muy eficiente; además, su funcionalidad de ventanas en pestañas es una excelente manera de minimizar el desorden y maximizar el estado real de la pantalla. Es fácilmente configurable editando ficheros de texto simples y ordenados. Fluxbox permite a los usuarios establecer sus propias directrices para e; escritorio, grados de funcionalidad y estilo. Por estas razones, un montón de gente usa Fluxbox sin importar sus recursos del sistema.

Fluxbox puede ser instalado y ejecutarse en una sesión alternativa a otros gestores de ventanas (como Metacity en GNOME o KWin en KDE). Se pueden tener varios gestores de ventanas alternativos accesibles desde la pantalla de inicio de sesión.

Características

Instalación

Para tener Fluxbox instala el paquete fluxbox del repositorio universe de Ubuntu.

Al reiniciar X.Org (con Ctrl+Alt+Retroceso) aparecerá el administrador de inicio de sesión que uses (GDM en Ubuntu), con la opción de Fluxbox en el menú de sesiones. Sin embargo, no se debería reiniciar el servidor gráfico en este punto.

¿Por qué no? Por varias razones, los paquetes de Fluxbox de los repositorios de Ubuntu crear ficheros xsession no estándares (al menos para Fluxbox), lo cual implica que no se cree automáticamente el fichero de configuración ~/.fluxbox/startup generado la primera vez que se inicia Fluxbox.

Clip.png Esto parece estar solucionado en la versión 0.9.14, pero deberías comprobarlo de todos modos.

Antes de iniciar Fluxbox debemos corregir esto.

Necesitas abrir y editar el fichero /usr/share/xsessions/fluxbox.desktop. Cuando veas el siguiente texto:

exec=fluxbox

Reemplaza esa línea por:

exec=startfluxbox

Una vez que hayas terminado de editar, reinicia el servidor X y arranca Fluxbox.

En algunas máquinas, Fluxbox parece cargarse muy lentamente. Esto se puede solucionar fácilmente agregando la siguiente línea a tu ~/.fluxbox/startup, justo después de ejecutar Fluxbox:

export LC_ALL=C

Uso

Como habrás notado, Fluxbox hace las cosas un poco diferente a GNOME/KDE/Xfce.

Acceder al menú y ejecutar programas

A diferencia de GNOME, KDE y Xfce, Fluxbox no tiene botón de «inicio». Para acceder al menú, simplemente haz clic con el botón derecho en el escritorio. Los submenús se expandirán al pasar el ratón sobre ellos. Para ejecutar un programa, selecciona su entrada en el menú y haz clic en la misma.

Cambiar de espacio de trabajo

Moviendo presionada la rueda del ratón sobre algún espacio vacío en el escritorio, te desplazas por los espacios de trabajo disponibles. Esta es una forma rápida de pasar de un escritorio al siguiente.

Ventanas en pestañas

La agrupación de ventanas en pestañas es una buena manera de conservar el estado real de la pantalla y reducir el desorden. Es un comportamiento único de Fluxbox, y en parte apela a un entorno de trabajo. Haz clic central en la barra de título de una ventana, mantenlo presionado y arrastra la ventana sobre otra. Las dos ventanas se juntarán en una sola con dos barras de título. Ahora puedes ver cada pestaña dentro de la nueva ventana cliqueando en sus respectivas barra de título.

Esto es particularmente útil si estás ejecutando una aplicación desde terminal. Agrupando la aplicación con su correspondiente ventana de terminal, se hace fácil alternar sucesivamente entre la salida de depuración en la terminal y la aplicación.

Configuración

The base Fluxbox install is quite bare. You only have a little taskbar/systray/clock combo at the bottom and the very cool right click menu. But how the heck to you start doing stuff? You've heard that Fluxbox is very customizable right? Well, here comes the meat and potatoes of it. You should be very familiar with the terminal because you will be using it a lot to do various things. Also be familiar with your favorite text editor, because all of Fluxbox's fun configuration is controlled by text files in ~/.fluxbox. ("~" is a shortcut for the current user's home directory) Oh and unless I tell you, you won't need sudo for anything because you will be working in your home directory.

Personalizar el menú

The first file up is ~/.fluxbox/menu. This file controls the right click menu. This may be a hidden file. If you are browsing for it in Nautilus, select "Show Hidden Files" in the View menu to make it visible. Very simple syntax really. Note that if you are installing Fluxbox from a normal Ubuntu/Kubuntu/Xubuntu install (ie, you already have a Window Manager), then all your apps are in the menu already and your menu file will look something like this

[begin] (fluxbox)
[include] (/etc/X11/fluxbox/fluxbox-menu)
[end]

Or at least it SHOULD. The first and last lines define the beginning and end of the menu file, so everything goes between them. That include thing pulls in the file generated in /etc/fluxbox. Its generated by the Debian Menu package (for which you need the menu package) and if thats installed before Fluxbox is, it will automatically be put in the menufile. Case in point, on my laptop I did a barebones install and installed Fluxbox before the menu package and it didn't show up (but is in the same place in /etc) but on my desktop (which has run GNOME, XFCE, and now Flux in the same install) the menu package was around long before Flux was and thus the include is there. No biggie if it isn't, you'll see how to make your own now!

So the basic syntax for an executable (normal program entry) is thus

[exec] (Name you want to show up in the menu) {command} <path to icon>

The exec says this is an executable entry. The () is the name you want to show up in the menu. Now command is what you'd type in the terminal to run this. Its also practice to use the absolute path. How do you find this? With the which command

$ which gaim
/usr/bin/gaim

Works for any command (almost...)

If there is an icon to go along with it, then put that in the <>, but its optional. Oh this all goes on one line and ends with a newline (basically hit return)

Now what about submenus? Right now any exec entry is going to be in the main menu. Its easy really

[submenu]  (Name of submenu) {}
stuff like execs and other submenus
[end]

Again submenu tells it that you are making a submenu, the name is in (). The {} is just a null command and is included by convention. You can put anything you want in the submenu, just when you are done defining it close it out with the end.

Now thats the basics about the Menu. Fluxbox generated all the config stuff for itself when it was installed, so its already there and you don't have to worry about it. Oh yes, you CAN have duplicate menu entries.

Here is the menu file from my laptop

[begin] (Fluxbox) {}
   [exec] (Gaim) {/usr/bin/gaim}
   [exec] (Firefox) {/usr/bin/firefox}
   [exec] (Irssi) { x-terminal-emulator -T "irssi-text" -e /usr/bin/irssi-text}
   [exec] (Bash) { x-terminal-emulator -T "Bash" -e /bin/bash --login}
   [exec] (BMP) {/usr/bin/beep-media-player}
   [exec] (VLC) {/usr/bin/vlc}
   [exec] (F-Spot) {/usr/bin/f-spot}
   [exec] (Acrobat Reader) {/usr/bin/acroread}
   [submenu] (Apps) {}
        [submenu] (Editors) {}
            [exec] (Emacs) {/usr/bin/emacs21}
            [exec] (Nano) { x-terminal-emulator -T "Nano" -e /bin/nano}
        [end]
        [submenu] (Net) {}

            [exec] (Telnet) { x-terminal-emulator -T "Telnet" -e /usr/bin/telnet}
            [exec] (w3m) { x-terminal-emulator -T "w3m" -e /usr/bin/w3m /usr/share/doc/w3m/MANUAL.html}
        [end]
        [submenu] (Programming) {}
            [exec] (Python) { x-terminal-emulator -T "Python (v2.4)" -e /usr/bin/python2.4}
        [end]
        [submenu] (Shells) {}

            [exec] (Dash) { x-terminal-emulator -T "Dash" -e /bin/dash -i}
            [exec] (Sh) { x-terminal-emulator -T "Sh" -e /bin/sh --login}
        [end]
        [submenu] (System) {}
            [exec] (gkrellm) { /usr/bin/gkrellm }
            [submenu] (Admin) {}
                [exec] (alsaconf) { x-terminal-emulator -T "alsaconf" -e /usr/sbin/su-to-root -p root -c /usr/sbin/alsaconf}
                [exec] (pppconfig) { x-terminal-emulator -T "pppconfig" -e /usr/sbin/su-to-root -p root -c /usr/sbin/pppconfig}
            [end]
            [exec] (aptitude) { x-terminal-emulator -T "aptitude" -e /usr/bin/aptitude}
            [exec] (DSL/PPPoE configuration tool) { x-terminal-emulator -T "DSL/PPPoE configuration tool" -e /usr/sbin/pppoeconf}
            [exec] (GDM flexiserver) {gdmflexiserver}
            [exec] (GDM flexiserver in Xnest) {gdmflexiserver -n}
            [exec] (GDM Photo Setup) {gdmphotosetup}
            [exec] (GDM Setup) {gksu gdmsetup}
            [exec] (pstree) { x-terminal-emulator -T "pstree" -e /usr/bin/pstree.x11}
            [exec] (reportbug) { x-terminal-emulator -T "reportbug" -e /usr/bin/reportbug --exit-prompt}
            [exec] (Run as different user) {/usr/bin/gksuexec}
            [exec] (Top) { x-terminal-emulator -T "Top" -e /usr/bin/top}
            [exec] (X-Terminal as root) {/usr/bin/gksu -u root /usr/bin/x-terminal-emulator}
        [end]
    [end]
    [submenu] (Help) {}
        [exec] (Info) { x-terminal-emulator -T "Info" -e info}
    [end]
    [submenu] (WindowManagers) {}
        [restart] (FluxBox) {/usr/bin/fluxbox}
    [end]
    [config] (Configuration) {}
    [submenu] (Styles) {}
        [stylesdir] (/usr/share/fluxbox/styles) {}
        [stylesdir] (~/.fluxbox/styles) {}
    [end]
    [workspaces] (Workspaces) {}
    [reconfig] (Reconfigure) {}
    [restart] (Restart) {}
    [exit] (Exit) {}
[end]

And the one from my Desktop

[begin] (fluxbox)
        [exec] (Evolution) {/usr/bin/evolution}
        [exec] (GAIM) {/usr/bin/gaim}
        [exec] (Bash) { x-terminal-emulator -T "Bash" -e /bin/bash --login}
        [exec] (Epiphany) {/usr/bin/epiphany}
        [exec] (BMP) {/usr/bin/beep-media-player}
        [exec] (Xine) {/usr/bin/xine}
[include] (/etc/X11/fluxbox/fluxbox-menu)
[end]

You can see the difference. My Desktop had the Debian Menus before I installed Fluxbox, hence the include came into play

For further examples of what you can do with a Fluxbox menu, see this page in the Fluxbox documentation.

Generación tradicional de menú

If you would prefer to create a menu using the traditional method for more of a standard look, then you should follow the basic process that is outlined below.

Fist extract the needed file and copy it to /usr/bin.

# cd /usr/share/doc/fluxbox
# gzip -d fluxbox-generate_menu.gz
# cp fluxbox-generate_menu /usr/bin

Now, make the file executable:

# chmod a+x /usr/bin/fluxbox-generate_menu

Next, it's time to generate the menu. Issue the command below as a user.

$ cd /home/username
$ fluxbox-generate_menu

This will also create a ~/.fluxbox/menuconfig file that can be customized to your preferences. You can, for example, add GNOME or kde support to the menu, or change the default browser, terminal, etc.

Finally, you need to edit the init file & change the menuFile path. Change the 'session.menuFile' entry to reflect the desired user name by editing the /home/username//.fluxbox/init

session.menuFile:       /home/username/.fluxbox/menu

Log back in and enjoy your new menu.

Atajos de teclado

Keyboard shortcuts are awesome to say the least. Why reach for the mouse when you can just hit a key combo and be done? The keyboard shortcut definitions are all stored in ~/.fluxbox/keys

Fluxbox comes with a few shortcuts preset, namely the familier Alt-TAB and mapping Alt+F1 through F12 to the 12 workspaces (If you have all of them enabled. By default Flux has 4 active). But we want to make our own don't we? Yup! Easy enough. Follow the syntax (again 1 per line)

<key combo> :ACTION

Now some things need explaining. One the key names. Alt is referred to as Mod1, CTRL as Control, and the Windows key is Mod4. Most of the other keys are what you expect. However if you want to be sure, there is a tool called xev . Call it on the command line and start hitting keys. A LOT of gibberish will come up, like this

KeyPress event, serial 30, synthetic NO, window 0x1800001,
    root 0x3e, subw 0x0, time 3967824504, (728,435), root:(799,525),
    state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

Now most of that is gibberish that we don't need. What we want is the part in keycode <something> (keysym <something>, Shift_L) That last part (Shift_L) is what X sees the key as, thus its name. So use it (note the rules above about naming overrule this, so Alt is still Mod1, etc)

So now we have the key names. The format for the key combo is simple. Just put down the combo! So Alt+F1 would be Mod1 F1 . Easy! Now the part after : is what the combo does. There are many options, but I am going to go through the ones I think will be most useful.

Acción Descripción
Close Cierra la ventana activa.
Minimize Minimiza la ventana activa.
MaximizeWindow Maximiza la ventana activa.
ShowDesktop Minimiza todas las ventanas.
Restart Reinicia Fluxbox.
Quit Termina Fluxbox y retorna a la pantalla de inicio de sesión.
ExecCommand Ejecuta el comando especificado.Run the specified command. Se puede indicar el nombre del comando, o bien la ruta absoluta del programa (como se ha hecho para el fichero del menú).

Again we have an example file from my desktop

Mod1 Tab :NextWindow
Mod1 Shift Tab :PrevWindow
Mod1 F1 :Workspace 1
Mod1 F2 :ExecCommand fbrun ;not the default for fluxbox, but this behaves like KDE/Gnome
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
Mod4 F1 :ExecCommand /usr/bin/evolution
Mod4 F5 :ExecCommand x-terminal-emulator -T "Bash" -e /bin/bash --login
Mod4 F2 :ExecCommand /usr/bin/epiphany
Mod4 F3 :ExecCommand /usr/bin/xine
Mod4 F4 :ExecCommand /usr/bin/best --no-tray

Cambiar el fondo

Now playing around with menus and keybinds is all well and good, but you want to set a background right? Easy!

fbsetbg -f /path/to/image_file

Tip: "fbsetbg -l" sets the last used wallpaper as the desktop and could be added to ~.fluxbox/init as: session.screen0.rootCommand: fbsetbg -l

Note: fbsetbg is just a wrapper for other things that set wallpapers, such as Esetroot and feh. If you have one of those installed fbsetbg will determine the best one to use and use it. To find out what fbsetbg is using run fbsetbg -i

Feh can be found in the feh package.

Esetroot comes with ETerm, which can be found in the eterm package.

Estilos

You can set the background just fine, but what about the theme. Well there is good news and bad news. The good news is that Fluxbox ships with a lot of themes (called Styles) by default. The bad news is that they only affect the windows themselves, not the "interior". That means if you are running GTK apps, then they will use the default grayish theme. Now thats good on its own, but it can really mess up a colorscheme. You can change it though, but first how to install and use Styles themselves.

Changing Styles is quite easy. Just to go the Styles submenu and click on it. Be warned though, some styles will override your background with their own, so you will have to change it back. Now what if you want to install a new style? Well first you have to know where to FIND them.

Here are some websites to get themes from:

Once you find one you like, download the tarball to ~/.fluxbox and extract it. One of two things will happen. It will be a good tarball and just put its files into ~/.fluxbox/styles, or it will put them someplace else in ~/.fluxbox. If the former occurs, then you are all set, the theme is in the Styles menu now. In the case of the latter you will have to find its style directory and move the file in it to ~/.fluxbox/styles. Fortunately 99% of the time it will make its own directory and the style dir will be in that (this is why we extracted in ~/.fluxbox, there aren't many dirs in there to begin with so its obvious when a new one is made).

Now thats all well and good, but I mentioned being able to apply GTK Themes. Yes you can. Install GTK Theme Switch with gtk-theme-switch and run it with switch2 . A little dialog will pop up with a dropdown of all the GTK Themes installed. Just select and apply. Keep in mind that the Style will still be in control of the Window Decorations (Titlebar, window borders, etc), so if the GTK Theme normally sets those, it won't, but the rest of it will work. A good source of GTK Themes is GNOME-Look. Stay away from the Metacity themes though. Those flat out won't work. Also if you need to install a new GTK theme, just download the tarball to ~/.themes and extract it.

Suppose you want to ensure that the background you set last stays there even after you reboot, just go find the *.cfg file for your theme. Look around for a line that goes like this; rootCommand: ##

Simply edit that line to read as follows;

rootCommand: fbsetbg -l 

or you can plainly edit the ~/.fluxbox/init file and place the following line there;

session.screen0.rootCommand: fbsetbg -l 

Fichero ~/.fluxbox/startup

You've heard of ~/.fluxbox/startup, now learn how to use the thing.

Like all good scripts, this one is nicely commented out with quick instructions.

Cambiar el fondo

To set the background (overriding the style!) uncomment the fbsetbg line and place the location of the image as the argument to fbsetbg. Then comment out the part about setting a black background. Loading Programs when Fluxbox Starts

Near the bottom of ~/.fluxbox/startup you will find a section that reads:

# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN & AT THE END.

Here put all the programs you want to load with Fluxbox. Some things to consider. XScreensaver (which controls the screensaver and screen locking) is not loaded Fluxbox by default, so you might want to add it to the startup script with xscreensaver & . The trailing ampersand (&) tells it to run in the background , like it should). This goes the same for other programs like the Beagle daemon, beagled & . For other programs, like GAIM, GKrellm (which is a REALLY good complement to Fluxbox), and anything else you want starting just put the command.

Dockapps y The Slit

Dockapps are small "dockable" applications which reside in a small "Dock" (which, in Fluxbox's terminology, is called "the slit") on one corner of your screen. They can be informative (clocks, calendars, system info), functional (volume controls, drive mounting utilities), convenient (controls for other applications), or even merely entertaining (minigames, fortune cookie displays, etc.). The vast majority of dockapps seem to have been originally developed for the WindowMaker and AfterStep window-managers, but work fine within Fluxbox. A good selection of them is available in the Ubuntu repositories (if you want to have a look, execute sudo apt-cache search dockapp in a terminal window), and many more can be found and compiled should you wish to do so.

You can load your dockapps when Fluxbox starts up by including them in ~/.fluxbox/startup the same way you start any other program in the startup file: simply type the command, followed by a trailing ampersand (&).

Some popular dockapps can be found in the Universe repositories and can be installed using apt-get or Synaptic:

  • wmxmms: usado para controlar XMMS (reproducir, pausar, siguiente, anterior, volumen, posición).
  • wmcpuload: muestra la carga de CPU en porcentaje.
  • wmmemload: muestra cuánta memoria está en uso.
  • wmweather, wmweather+: muestra la temperatura.
  • wmclockmon: muestra la fecha y la hora.
  • docker: muestra applets de GNOME (como nm-applet y gnome-power-applet) sin el panel.
  • wmmount: monta/desmonta/abre volúmenes como unidades de CD y discos duros.
  • wmmatrix: muestra el salvapantallas de Matrix, sólo como diversión.
  • wmtop: muestra lo procesos corriendo actualmente que más recursos están usando.

Gnome Support

Many people like to use Nautilus, Gnome themes, or even the Gnome panel in Fluxbox. In order for this to function smoothly, the following must be added to your startup script:

GSDPID=`pidof gnome-settings-daemon`
if [  "x$GSDPID" == "x" ]; then
    gnome-settings-daemon &
fi

Starting Fluxbox

Right at the bottom is the command to start Fluxbox. Notice that here we are running /usr/bin/fluxbox WITHOUT a trailing ampersand (&).

Fuentes

Enlaces externos

Wikipedia logo.png Wikipedia alberga un artículo enciclopédico sobre Fluxbox.
Herramientas personales