Fluxbox Newbie: Difference between revisions

From SlackWiki
Jump to navigation Jump to search
(basic fluxbox configuration and installing openoffice)
 
m (format edit)
 
Line 104: Line 104:
Right click on the desktop to get this from the Fluxbox menu.
Right click on the desktop to get this from the Fluxbox menu.


* Create a simple menu.
* <big>Create a simple menu.</big>
<code>
<code>
  [user@host] ~/ $ kate .fluxbox/menu.simple &
  [user@host] ~/ $ kate .fluxbox/menu.simple &

Latest revision as of 14:18, 31 July 2011

Fluxbox Desktop -- basic configuration

This is my attempt to contribute to Slackware documentation with a newbie oriented how-to for initially setting up a usable Fluxbox desktop. There is also a section on installing OpenOffice, since many desktop users will want that program.


Use at your own risk!


I assume a default Slackware install.


Reference:
http://www.fluxbox.org
http://fluxbox-wiki.org

Fluxbox is a very nice desktop window manager that has most everything you need. It is minimal, which allows good desktop performance on older or moderate hardware. Plus, it can be configured to really simplify things so you don't have to deal with lots of programs you don't understand or ever use. Besides simplification, the right configuration of Fluxbox can add quite a bit to your computing productivity.

Note: One time fluxbox refused to start for me. As I recall, the problem was fixed by removing the .Xauthority and .ICEauthority files from my home folder and trying again.

Note: the [user@host] ~/ $ represents the command prompt with ~ being a shortcut for your /home/username folder.

Tip: Use "bash completion" when working with directories and files from the command prompt. Type the first few letters of the directory or file you want and the "tab" key. If the text completes, then you are on the right path. Pressing "tab" twice will give a list of possible matches.

Tip2: use the command "pwd" to show your present working directory and "whoami" to show your username.

Choosing Fluxbox

  • Choose Fluxbox as the the default window manager

After you log in, from the console or a terminal screen in X:

[user@host] ~/ $ xwmconfig 

( select fluxbox and OK )


If you are in X, close the current X session, log out, close, exit, or end.

Start up the (new) default fluxbox

[user@host] ~/ $ startx 

Fluxbox Configuration

Now, let us get fluxbox configured. You will need to look into your ~/.fluxbox directory

Right-click on the desktop to display the menu and select rxvt or xterm which will open a terminal window.


The Fluxbox configuration is kept in a hidden folder (dotfile) which may or may not be visible in an ordinary file browser, but won't be shown with a plain "ls" command, unless it is specified.

[user@host] ~/ $ ls .fluxbox
   apps    keys           menu    init    slitlist
   init    windowmenu     overlay startup backgrounds  styles

You should see something resembling this.
Fluxbox should be started once before you modify it because it writes initial configurations in your .fluxbox folder.

  • Format the clock

From the menu, select Fluxbox-menu | Configure | Toolbar | Edit clock format
A small edit box opens and you can modify the format string and then press "enter." Here is a suggestion:

%I:%M %a %b %e

  • Add keyboard access to main menu

Use the command below or right-click on the desktop to display the menu and select an editor from the Editors section -- gvim is good, but kate or kwrite are easier and more intuitive to use. In fact, with kate you have a built-in terminal, which might make things easier.

[user@host] ~/ $ kate .fluxbox/keys &

Edit the keys file by inserting the following at the very beginning, so it is easy to find if you want to change it later. (I assume you have a US pc105 keyboard, with two "windows" keys and one "menu" key on the bottom row.)

# keyboard access to main menu
# Menu key is next to right Control key
None Menu     :RootMenu
Shift Menu    :HideMenus
# optional, Super_L is the left windows key
None Super_L  :RootMenu
Shift Super_L :HideMenus

You can use the "xev" command to see the names and keycodes of your keyboard keys.

[user@host] ~/ $ xev

When done, save the keys file.

Test it by pressing the Menu key and the Shift-Menu to show/hide the Fluxbox menu.

You may reload the configuration by using the menu Fluxbox-menu | Reload config Right click on the desktop to get this from the Fluxbox menu.

  • Create a simple menu.

[user@host] ~/ $ kate .fluxbox/menu.simple &

kate may say it cannot read the file, but continue on. It will give you a blank file.

Copy/paste the following menu:

# My Fluxbox menu
[begin] (Fluxbox menu.simple) {} < >
[encoding] {UTF-8}
   [exec] (Terminal) {konsole} < >
   [exec] (Browser) {firefox} < >
   [exec] (Editor) {kate} < >
   [exec] (Reader) {okular} < >
   [exec] (Audio) {audacious} < >
   [separator]
   [submenu] (Net) {} <>
       [exec] (Browser) {seamonkey} < >
       [exec] (Mail) {thunderbird} < >
       [exec] (IM) {pidgin} < >
       [exec] (Chat) {xchat} < >
       [exec] (FTP) {gftp} < >
   [end]
   [submenu] (Media) {} < >
       [exec] (Graphics) {gimp} < >
       [exec] (Photos) {gqview} < >
       [exec] (Media Player) {xine} < >
       [exec] (Scanner) {xsane} < >
       [exec] (CD Copy) {k3b} < >
   [end]
   [submenu] (Office) {} <>
       # openoffice and acrobat are not included in Slackware
       [submenu] (OpenOffice) {} <>
               [exec] (Writer) {swriter} <>
               [exec] (Spreadsheet) {scalc} <>
               [exec] (Presentation) {simpress} <>
               [exec] (Draw) {sdraw} <> 
       [end]
       [exec] (OfficeSuite) {soffice} < >
       [exec] (PIM kde) {kontact} < >
       [exec] (Acrobat) {acroread} < >
       [exec] (Accounts) {kmymoney} < >
   [end]
   [submenu] (Tools) {} < >
       [exec] (Kill) {xkill} < >
       [exec] (Xterm) {xterm} < >
       [exec] (Files) {dolphin} < >
       [exec] (Calculator) {kcalc} < >
       [exec] (System) {ksysguard} < >
       [exec] (Manual) {xman} < >
       [exec] (Help) {khelpcenter} < >
       [exec] (Lock) {xlock} < >
   [end]
   [separator]
   [submenu] (Fluxbox-menu) {} <>
       [config] (Configure) {} <>
       [submenu] (Styles) {Choose a style...} <>
           [stylesdir] (/usr/X11R6/share/fluxbox/styles) {} <>
           [stylesdir] (~/.fluxbox/styles) {} <>
       [end]
       [workspaces] (Workspace List) {} <>
       [submenu] (Tools) {} <>
           [exec] (Windowname) {xprop|grep WM_CLASS|cut -d \" -f 2|xmessage -file - -center} <>
           [exec] (Screenshot - JPG) {import screenshot.jpg && display -resize 50% screenshot.jpg}
           [exec] (Screenshot - PNG) {import screenshot.png && display -resize 50% screenshot.png}
           [exec] (Run) {fbrun }
           [exec] (Regen Menu) {fluxbox-generate_menu }
       [end]
       [reconfig] (Reload config) {} <>
       [restart] (Restart) {} <> 
       [exec] (Shutdown) {/usr/bin/sudo /sbin/shutdown -h now} <>
       [separator]
       [exit] (Exit) {} <>
   [end]
   [separator]
   [exit] (Exit) {} <>
[endencoding]
[end]

To add a program, the syntax is:

[exec] (Label) {command} < optional path to .xpm icon >

Also, every [submenu] tag must have a matching [end] tag.

Save this file as .fluxbox/menu.simple (kate File | Save)

Do not overwrite your .fluxbox/menu file. You may want it later.


Open the file .fluxbox/init

kate .fluxbox/init &

Or just use kate's File | Open. Since .fluxbox should be the current directory, the file dialog should show the file, or you can enter .fluxbox/init in the Name box at the bottom of the dialog.

Find the following line (near the bottom)

session.menuFile:	~/.fluxbox/menu

Change "menu" to "menu.simple" and save/close the init file.


  • Now for the desktop background.

Copy your favorite background .jpeg file to .fluxbox/backgrounds/my_favorite_background.jpg

[user@host] ~/ $ cp path-to/my_favorite_background.jpg .fluxbox/backgrounds/
[user@host] ~/ $ chmod 644 .fluxbox/backgrounds/*

Now open the overlay file .fluxbox/overlay and add these lines:

background: fullscreen
background.pixmap: ~/.fluxbox/backgrounds/my_favorite_background.jpg

Your overlay file should look like this:

! The following line will prevent styles from setting the background.
! background: none
background: fullscreen
background.pixmap: ~/.fluxbox/backgrounds/my_favorite_background.jpg

Save/close the overlay file.


See what it looks like with the fbsetbg command

[user@host] ~/ $ fbsetbg ~/.fluxbox/backgrounds/my_favorite_background.jpg

Now, make sure all your modified files are saved and select Restart from the Fluxbox menu --select Fluxbox-menu | Restart


  • Learn more from the man pages:

[user@host] ~/ $ man fluxbox | less
[user@host] ~/ $ man fluxstyle | less

(press "q" to quit the less pager or man page)

Or use the Help --> khelpcenter; select Unix Manuals, section 1, fluxbox; or even xman.

I also suggest doing a web search for .Xdefaults or .Xresources files.

Hopefully, you will like the look and feel of Fluxbox. Of course, there are more things you can do with your configuration, but hopefully this introduction has shown you some possibilities and got you off to a good start.

Installing Open Office

Since OpenOffice is probably wanted by many desktop users, but not included in Slackware, I have these directions for getting it installed.

  • Uninstalling OpenOffice for Upgrade

See if you have OpenOffice packages installed. The packages have names containing ooobasis or openoffice.

[user@host] ~/ $ ls /var/log/packages | grep ooo
[user@host] ~/ $ ls /var/log/packages | grep openoffice

If you are going to upgrade, first uninstall your existing packages. If you did not use Slackware compatible packages, then you can probably simply delete the openoffice.org directories under /opt. Otherwise, use pkgtool.

[user@host] ~/ $ su
 password
[root@host] ~/ # pkgtool

Choose Remove Packages and scroll down to the openoffice packages.
Select them with the space bar and then tab to OK and press enter.

Be careful with pkgtool or you will remove the wrong packages.

Or, to just remove the directories (this does not update Slackware's package tracking).

[root@host] ~/ # cd /opt
[root@host] opt/ # rm -f openoffice3.org
[root@host] opt/ # rm -f openoffice3.org3


  • Downloading OpenOffice.org

Point your browser to http://www.openoffice.org

Click on "I want to download OpenOffice.org"

Choose "Searching for another version"

This takes you to the alternate downloads page

Uncheck the box [] "include the JRE to the download"

Slackware includes the java JRE and it is usable by OpenOffice.

Choose the "Linux Intel RPM" for your language (2nd column).

Save the OOo_3.3.0_Linux_x86_install-rpm_en-US.tar.gz to your downloads or Downloads directory (wherever you put tarballs) (version may vary).

Open a terminal and untar the tarball.

[user@host] ~/ $ cd <path-to-download-folder>
[user@host] downloads/ $ tar -xzf OOo_3.3.0_Linux_x86_install-rpm_en-US.tar.gz

This creates a folder named OOO330_m20_native_packed-1_en-US.9567, with an RPMS subdirectory and other things.


Change to the OOO... /RPMS folder and see what you have

[user@host] downloads/ $ cd OOO330_m20_native_packed-1_en-US.9567/RPMS
[user@host] RPMS/ $ ls

There should be quite a few .rpm files. We will change these to .tgz files with rpm2tgz.

[user@host] RPMS/ $ rpm2tgz *.rpm

This takes a little while. When done there should be a matching .tgz file for each .rpm file.

  • Installing OpenOffice.org

Now change to root and install the packages.

[user@host] RPMS/ $ su 
password
[root@host] RPMS/ # installpkg *.tgz

This also takes a little while.

Now create symbolic links to put the OpenOffice executables in your path. Note: OpenOffice creates two directories in /opt, /opt/openoffice3.org and /opt/openoffice3.org3

The /opt/openoffice3.org3 is the directory that contains the executables.

[root@host] RPMS/ # cd /usr/bin

(The ln -s TARGET [LINK_NAME] command creates symbolic links)
Use the bash completion with these commands ln -s /opt/openo[tab] ... /program/s[tab] to be sure you are correctly referencing the executable programs.


[root@host] bin/ # ln -s /opt/openoffice3.org3/program/soffice
[root@host] bin/ # ln -s /opt/openoffice3.org3/program/sbase
[root@host] bin/ # ln -s /opt/openoffice3.org3/program/scalc
[root@host] bin/ # ln -s /opt/openoffice3.org3/program/sdraw
[root@host] bin/ # ln -s /opt/openoffice3.org3/program/simpress
[root@host] bin/ # ln -s /opt/openoffice3.org3/program/swriter
[root@host] bin/ # exit

  • Try it out

Just select OpenOffice or OfficeSuite in your fluxbox menu.simple.

  • I hope this all worked for you.

Check out http://slackbuilds.org for more packages. The accounting program kmymoney is found there. As far as installing Adobe Acrobat goes, there is also a package at slackbuilds.org, but you may have better luck just downloading it from Adobe and running their AdbeRdr9...sh installation program. Same for Adobe flashplayer. IMHO, flashplayer is the more necessary program.
Have fun!