Sunday, February 28, 2010

Fluxbox toolbar and menu

So now that we have apps to run, lets work on the usability of the system. First two things that seen really unhelpful to me are the defaults for the fluxbox toolbar and menus.

Toolbar
I'm going to put my toolbar top center of my screen with a total width of 80%. This means even with windows "full screen" I'll have 10% of my screen width both at the top left and right where I can bring up my fluxbox menu without minimizing every window first. If you've been playing with apps running with maximized windows you'll know what I'm talking about. You can setup the toolbar like so:
  1. Right click the desktop for fluxbox menu, click Configuration, click Toolbar, click Placement, then choose Top Center.
  2. Right click the desktop for fluxbox menu, click Configuration, click Toolbar, HOVER over Toolbar width percent
  • If you want to reduce the % of the screen, LEFT click
  • If you want to increase then RIGHT click
Cool huh? Since we know everything in fluxbox is driven by configuration files, we could have easily made these changed by browsing into the ~/.fluxbox directory and modifying the correct file. In this case you'll find these settings in the "init" file, we'll be modifying it for some other reasons sometime soon.

Menu
I hate the default menu that fluxbox offers me, I want everything at most two levels deep so I can launch my app with quickness.

Let's look at ~/.fluxbox/menu and see what the default menu config looks like:
[begin] (fluxbox)
[include] (/etc/X11/fluxbox/fluxbox-menu)
[end]
Seems pretty straight forward, it's just calling back to some system generated menu in /etc to paint our menu. So EVERYTHING in our menu right now is coming directly out of fluxbox.

OK, then let's mess with it! First thing I'm going to paste my own menu items between the begin and include lines, making it look like so:
[begin] (fluxbox)
[submenu] (Accessories) {}
[exec] (Aterm) {aterm -geometry 70x35} <>
[exec] (Galculator) {/usr/bin/galculator} <>
[exec] (Geany) {/usr/bin/geany} <>
[exec] (PCmanFM) {/usr/bin/pcmanfm} <>
[end]
[submenu] (Internet) {}
[exec] (Gftp) {/usr/bin/gftp-gtk} <>
[exec] (Opera) {opera} <>
[exec] (Pidgin) {/usr/bin/pidgin} <>
[exec] (Putty) {/usr/bin/putty} <>
[exec] (TS Client) {/usr/bin/tsclient -f} <>
[end]
[submenu] (Office) {}
[exec] (Abiword) {/usr/bin/abiword} <>
[exec] (Gnumeric) {/usr/bin/gnumeric} <>
[exec] (Xpdf) {/usr/bin/xpdf} <>
[end]
[submenu] (System) {}
[exec] (Root Xterm) {/usr/bin/su-to-root -X -c xterm} <>
[end]
[exit] (Exit)
[include] (/etc/X11/fluxbox/fluxbox-menu)
[end]
So now I have all my menu items above the fluxbox generated ones. Very cool, everything is two layers deep and where I want them (mostly) but I still have that ugly crap menu below everything else.

Instead of removing the "include" line, let's just remark it out incase we want to quickly turn it back on later for some reason. New menu looks like this:
[begin] (fluxbox)
[submenu] (Accessories) {}
[exec] (Aterm) {aterm -geometry 70x35} <>
[exec] (Galculator) {/usr/bin/galculator} <>
[exec] (Geany) {/usr/bin/geany} <>
[exec] (PCmanFM) {/usr/bin/pcmanfm} <>
[end]
[submenu] (Internet) {}
[exec] (Gftp) {/usr/bin/gftp-gtk} <>
[exec] (Opera) {opera} <>
[exec] (Pidgin) {/usr/bin/pidgin} <>
[exec] (Putty) {/usr/bin/putty} <>
[exec] (TS Client) {/usr/bin/tsclient -f} <>
[end]
[submenu] (Office) {}
[exec] (Abiword) {/usr/bin/abiword} <>
[exec] (Gnumeric) {/usr/bin/gnumeric} <>
[exec] (Xpdf) {/usr/bin/xpdf} <>
[end]
[submenu] (System) {}
[exec] (Root Xterm) {/usr/bin/su-to-root -X -c xterm} <>
[end]
[exit] (Exit)
# [include] (/etc/X11/fluxbox/fluxbox-menu)
[end]
That takes care of the ugly menus, and we can just stop here. If we add any apps we can add them to our menu, if it gives us any trouble we can always launch them from a terminal, and absolute worst case we can enable the fluxbox menu anytime we want by removing that # from our config.

Now getting all sorts of practical, I only have about a dozen apps I've installed that I'll be using, maybe I don't need two layers of menus, here is an option:
[begin] (fluxbox)
[exec] (Abiword) {/usr/bin/abiword} <>
[exec] (Aterm) {aterm -geometry 70x35} <>
[exec] (Galculator) {/usr/bin/galculator} <>
[exec] (Geany) {/usr/bin/geany} <>
[exec] (Gftp) {/usr/bin/gftp-gtk} <>
[exec] (Gnumeric) {/usr/bin/gnumeric} <>
[exec] (Opera) {opera} <>
[exec] (PCmanFM) {/usr/bin/pcmanfm} <>
[exec] (Pidgin) {/usr/bin/pidgin} <>
[exec] (Putty) {/usr/bin/putty} <>
[exec] (TS Client) {/usr/bin/tsclient -f} <>
[exec] (Xpdf) {/usr/bin/xpdf} <>
[exec] (Xterm) {/usr/bin/su-to-root -X -c xterm} <>
[exit] (Exit)
# [include] (/etc/X11/fluxbox/fluxbox-menu)
[end]
So this is the menu I'm going to run with, I'll leave a few items in there unexplained so you can go find out what some of those elements are for on your own.

One last scenario, what if someone doesn't know what all those crazy linux apps name mean? How would you know geany was a text editor? You could make this menu really friendly for non-linux users:
[begin] (fluxbox)
[exec] (Calculator) {/usr/bin/galculator} <>
[exec] (Chat Client) {/usr/bin/pidgin} <>
[exec] (Linux Console) {aterm -geometry 70x35} <>
[exec] (File Manager) {/usr/bin/pcmanfm} <>
[exec] (FTP Client) {/usr/bin/gftp-gtk} <>
[exec] (PDF Viewer) {/usr/bin/xpdf} <>
[exec] (Remote Desktop) {/usr/bin/tsclient -f} <>
[exec] (Root Terminal) {/usr/bin/su-to-root -X -c xterm} <>
[exec] (Spreadsheet) {/usr/bin/gnumeric} <>
[exec] (SSH Client) {/usr/bin/putty} <>
[exec] (Text Editor) {/usr/bin/geany} <>
[exec] (Web Browser) {opera} <>
[exec] (Word Processor) {/usr/bin/abiword} <>
[exit] (Exit)
# [include] (/etc/X11/fluxbox/fluxbox-menu)
[end]
I'm not going this route, but you can if you like. This is the greatest strength of linux, you can have it exactly your way!

Let's add one more line to whatever menu we decide on:

 [exec] (Screenshot) {import -pause 3 -window root ~/screenshot.jpeg} <>

*** I had to update to remove a space between the hyphen and w on window. Copy/paste failed me.

This will use part of imagemagick to wait 3 seconds then take a screenshot of the entire desktop and save it as "screenshot.jpeg" in our home directory. Remember to go rename it or save it off somewhere else before trying to snap more. By waiting 3 seconds it will let you pull up your fluxbox menu or put your mouse over something before it snaps.

I think that's enough about the toolbar and the menu for today. I'll circle back on my promise for doing the aterm configuration later, this post is already long enough!

Saturday, February 20, 2010

Adding some apps

So things are looking better on the desktop now and we still have a lean stable linux box. Our new problem is that we still can't really use it like a computer. Some might argue that all we need these days is a browser, but I think we should load up a few apps incase we need to do some work without a cloud connection. I've lined up some general PC uses below and the program I've selected to install on my box to do the job.

Accessories
There are a few things you just need in whatever OS you are running, we already have our file manager and text editor, but here are a few more apps to round us out:
  • Calculator: Sure we can do math in our spreadsheet program, from the cli with bc, or in any programming language, but I think every OS should have a handy calc. I haven't found my perfect calculator yet, but galculator has worked great for me for a long time so I'll stick with that.
  • Terminal: I know you are thinking we already have two; xterm and eterm. Yeah we do, but if we install aterm we get eye candy. Xterm will always be there if I need it, and I only load eterm to get my background image loaded with fbsetbg, but aterm is my main console all day everyday. We'll just install it for now and slick it up later.
  • Screenshot: it's cool to create our perfect desktop environment, but how do we collect our bragging rights? You might want to take a screenshot, or you may really need to document something you see on your screen at any given time. For this I use imagemagick with some cool foo in my FB menu, but I'll save that for later.
Office Productivity
You can pick from a few office suites to load like Open Office or Koffice, but if you want to go with a "best of breed" approach, you can pick the individual applications you want to build your own office suite with. I do run full OO on my Ubuntu box so I can afford to go lightweight on my Debian install.
  • Word Processor: So in MS world you've got Word, for basic/free built in you have Wordpad (which when working on a Windows server, I'm actually quite fond of.) In linux land we usually see people running Open Office Word Processor, and it's a fine choice with the ability to use LOTS of document format. Abiword has been around for a long, long time, oh and it's pure awesome so I'm going to install it.
  • Spreadsheet: Again Open Office Spreadsheet gives us a full feature alternative to Excel, but I'm going to go light and I'm choosing Gnumeric for this.
  • PDF viewer: So you can create PDF's in linux pretty easily, but to view them you need to load another app. I've only used Xpdf for any long amount of time so it's the only one I can recommend.
Internet Apps
I have some applications I use all of the time, they are particular to my job and the way I use my computers and servers so you may not need them. Since I'm installing them on my box, I'll document them here for completeness. We already have Opera so the most important internet app is already running on the system, now we just need to add whatever we'll be using on this box.
  • Email: If you wanna go big and install a dedicated email program, here is where I'd put in sylpheed-claws, but I'm happy not to have it so I'm personally skipping. I can use webmail with any of my accounts, or just keep the imap connection going in Opera.
  • FTP Client: I move lots of files for personal use and for work, they are often large archives of log files, etc. Since I work with people running Windows, Mac, and linux it's really handy to keep a dedicated FTP server out on the internet where I can create accounts and isolate directories for everyone I'm working with. Since I spend so much time using FTP I actually run a thick app for it, gftp. It's absolutely wonderful and I can't imagine life without it.
  • IM Client: Since I work with people using AOL, MSN, Google, and Yahoo IM accounts, a multi-protocol IM client is a must. I've used Pidgin since it was released and I've never found anything lighter that works better. Recently I installed Meebo on one of my PC's and my wifes Droid, it seems to work pretty well but I'm gonna stick with what I know, it'll be easier for me to import contact lists if I don't change right now.
  • Telnet/SSH client: Just PuTTY.
  • Remote Desktop: I spend most days working on a variety of linux and Windows servers, and after web consoles and ilo every other connection method short of walking to the keyboard requires a special client to be installed rather than a browser. VNC is installed on some servers because Terminal Services is not supported, most of the rest are Windows and use RDP only. TSclient is a very full featured front end that keeps a connection history and gives you easy options for mapping your drive across or modifying display settings per connection. VERY nice app. I once had an issue getting protocols put into tsclient so now I install them first then install the gui frontend in a second step. I'm sure there is a better answer but I haven't bothered searching for it.
OK so how hard is it to install all of the applications we need in our OS? You can put them all in on one line, but I'm gonna split them up for blog formatting:
debian:/home/thom# aptitude install galculator aterm imagemagick
debian:/home/thom# aptitude install abiword gnumeric xpdf
debian:/home/thom# aptitude install gftp pidgin putty
debian:/home/thom# aptitude install vncviewer rdesktop
debian:/home/thom# aptitude install tsclient

OK, about 75Mb later we've got a pretty good set of apps we can run! Now all you have to do is search out all the menus and try to find what we've installed. If you can't find it you can launch any of them from the console.

Next time we'll dress up that Aterm config, strip down our fluxbox menu, setup imagemagick for some screenshots, and kick our eye candy up another notch.

Sunday, February 7, 2010

Fluxbox beautification

Ok I've been talking about cleaning up our gui for a while, today let's make some progress. We've been logging in as our user and typing "startx" to launch fluxbox every time we boot up. Seems ridiculous, computers are good at doing things over and over. First thing lets tell Debian it can launch fluxbox upon successful authentication of our normal user. This is a simple two step process.

First, there is a hidden file in our home directory called .profile, this is basically a bunch of commands that will run everytime you log in. Why not put just put "startx" at the bottom of that file? Well there is one good reason, what if you are remotely connecting to the box over ssh? Here is another, what if you really botch up your startup or fluxbox config and you need to log into it from another terminal session without launching another instance of the same problem? So the best plan would be to tell Debian that if we are logging into an initial session directly from the attached keyboard and monitor to automatically lauch the gui, but ONLY for the initial local login. Here are the bottom 3 lines from my .profile that does that:
if [ $(tty) == /dev/tty1 ]; then
startx
fi

Second, now what happens if we have other window managers installed, which one do we start? How do we tell linux which window manager to choose? Just like logging into our account triggers .profile to be read, doing a startx will make linux check for a file in the users home directory called .xinitrc to see if you have any preferences you'd like setup when going into graphical mode. Fluxbox has some peculiarities we'll be touching on shortly, but the important thing is that we use the command "startfluxbox" in our .xinitrc to launch it. Here is the LAST LINE in my .xinitrc:
startfluxbox

It's entirely possible that you don't see an .xinitrc file in your home directory yet. If you are in PCManFM and showing hidden files and it's not there, just right click and Create New -> Text File, then change the filename to exactly ".xinitrc".

IMPORTANT - making these types of changes can break lots of stuff, so here is what I'd do if you are worried about recovering to what you currently have. Open up your home directory in PCManFM and copy any file you plan to change and save them back into the same directory with a "-OLD" at the end. Now we can make changes to the config files and IF we have any trouble we can login as root, go to the users home directory, delete the bad/active config files with the rm command, then copy the -OLD files back to the original names with the cp command. We'll be back to square 1 with our normal user account and able to try again. I won't be talking about backing out configs and commands much, but you should always work with a safety net. I do.

OK once we have our original config files backed up as -OLD files, we ca update the active files them with Geany without doing a su to root because they are in our user accounts home directory. We already have full control of these files. It's a good time to break the habbit of switching to root when not really neccessary. We'll need to exit fluxbox and logout of our user account to test this. Once we log back into linux we should go straight to our fluxbox desktop. OK, I just tried it and it worked perfectly. One final note, I like logging in at the cli and having it kick off fluxbox, it's the very leanest way to get the job done. If you search around you'll see a brazillian posts about gdm, xdm, etc. those are all gui front ends for the login process. I think they just slow down boot times and waste system resources. If you're into bloat maybe you should be reading somebody's blog about fluxbuntu or something.

OK, with all the baby crap out of the way, let's actually do something with fluxbox. You've seen we can do all this configuration and customization of fluxbox from the fluxbox menus inside of fluxbox. This is basically there for noobs. All of fluxbox is driven off of configuration files. Let's get a new theme on here. First thing go into the .fluxbox directory and you'll see a styles directory. Open that up and create a new empty file in there, name it whatever you want and open it with geany, then paste in the follow and save it:
# Thom's style
toolbar: flat crossdiagonal gradient
toolbar.color: grey20
toolbar.colorTo: grey10
toolbar.button: parentrelative
toolbar.button.picColor: grey85
toolbar.button.pressed: flat crossdiagonal gradient
toolbar.button.pressed.color: grey50
toolbar.button.pressed.colorTo: grey80
toolbar.label: parentrelative
toolbar.label.textColor: grey85
toolbar.windowLabel: parentrelative
toolbar.windowLabel.textColor: grey85
toolbar.clock: parentrelative
toolbar.clock.textColor: grey85
toolbar.justify: right
toolbar.font: lucidasans-10

menu.title: flat crossdiagonal gradient
menu.title.color: grey50
menu.title.colorTo: grey10
menu.title.textColor: white
menu.title.font: lucidasans-10
menu.title.justify: right

menu.frame: flat crossdiagonal gradient
menu.frame.color: grey50
menu.frame.colorTo: grey80
menu.frame.textColor: grey20
menu.frame.disableColor: grey40
menu.frame.font: lucidasans-10
menu.frame.justify: left

menu.bullet.position: right
menu.bullet: triangle

menu.hilite: flat crossdiagonal gradient
menu.hilite.color: grey50
menu.hilite.colorTo: grey10
menu.hilite.textColor: white

window.title.focus: flat crossdiagonal gradient
window.title.focus.color: grey50
window.title.focus.colorTo: grey10
window.title.unfocus: flat diagonal gradient
window.title.unfocus.color: grey50
window.title.unfocus.colorTo: grey20

window.label.focus: parentrelative
window.label.focus.textColor: white
window.label.unfocus: parentrelative
window.label.unfocus.textColor: grey60

window.button.focus: parentrelative
window.button.focus.picColor: grey85
window.button.unfocus: parentrelative
window.button.unfocus.picColor: grey60
window.button.pressed: flat crossdiagonal gradient
window.button.pressed.color: grey50
window.button.pressed.colorTo: grey80

window.handle.focus: flat crossdiagonal gradient
window.handle.focus.color: grey50
window.handle.focus.colorTo: grey10
window.handle.unfocus: flat diagonal gradient
window.handle.unfocus.color: grey50
window.handle.unfocus.colorTo: grey20

window.grip.focus: parentrelative
window.grip.unfocus: parentrelative

window.frame.focusColor: grey10
window.frame.unfocusColor: grey50

window.font: lucidasans-10
window.justify: right

borderColor: grey20

bevelWidth: 1
borderWidth: 1
handleWidth: 4

*textColor: grey85
*Font: lucidasans-10

rootCommand: fbsetroot -gradient flatcrossdiagonalgradient -from rgb:4/6/8 -to rgb:3/48/6

bbpager.desktop.focus: flat interlaced crossdiagonal gradient
bbpager.desktop.focus.color: grey50
bbpager.desktop.focus.colorTo: grey10
# END

Once that is saved and closed, right click your desktop to pull up your fluxbox menu and go to styles, you should now see your new style there so go ahead and click it. OK there we've got a nice black and dark gray theme. All of the other styles on the menu are all built in and reside elsewhere in the system. Whatever styles you put into your styles directory are only there for you to use. The most important thing to understand is that the fluxbox themes are completely file driven and customizable. Go search around for fluxbox screenshots and see what people have come up with, often you'll find their config files on the same page as their screenshots.

OK, let's put one more peice of happiness on here before we call it a day. Open up Opera and go find a nice jpg or png you'd like for a background image and save it into ~/.fluxbox/backgrounds.

Now open a terminal and su to root so you can run aptitude:
debian:/home/thom# aptitude install eterm

Eterm has a component that fluxbox will need to setup wallpaper. Next we can open up /.fluxbox/startup with geany. Let's look for a line:
/usr/bin/fbsetroot -solid black

and we'll remark that line out like so:
# /usr/bin/fbsetroot -solid black

Now find this line:
# fbsetbg -C /usr/share/fluxbox/splash.jpg

And we'll remove the # and change the path to our personal background directory:
fbsetbg -C ~/.fluxbox/backgrounds/wallpaper.jpg

Now we can exit fluxbox, log out of Debian, and log back into Debian as our normal username. We should have fluxbox auto start, to our slick theme, and display our wallpaper. Little things you can take for granted huh?


Saturday, February 6, 2010

Installing a decent web browser

OK, w3m and links aren't gonna cut it now that we have our graphical environment up and running so we need to fetch a better browser.

You can choose from a bunch via aptitude, if you want to stick with a free and supported option I'd say go with iceweasel. Iceweasel will install into a Mozilla directory, supports extensions, and has an icon that looks a bit like Firefox... Hmmm whats going on here? Basically Debian has requirements for all packages that they put into the APT repositories, and although Firefox is considered by the world to be free there are components it holds rights to like icons and logos. The compromise is this: someone can take all the code that is firefox, call it something else, and release it under a free license. The name they choose to call it is iceweasel. If my 10,000' view summary isn't enough for you google will take you all back through this history. Toss Ubuntu into that search to find the deeper interesting dirt. For those of you just needing a browser that is familiar to what you already use, here you go:
debian:/home/thom# aptitude install iceweasel
Boom, done, you can skip the rest of this post.

OK for the real cowboys ready to step up their game a bit, I think Firefox is too bloated and slow. 99% of the time I don't need all that it can offer and I just want something light and fast. I know everyone is thinking Chrome is all awesome, but I still prefer Opera for these reasons:
- small install size
- light memory usage
- FAST web browser
- built in email client with imap support
- built in IRC chat client
- bag of chips

OK so by installing this I can skip installing any other browser, email client, or IRC chat client? Yes it is so. Now I'm not going to say it's the best at any of them, but for me it's the perfect balance of what you get vs what you pay. So why wouldn't you want to use Opera? Here is the list of cons:
- it is proprietary software
- it's not in the APT repos
- you can't use Firefox or Chrome extensions with it

If I have to choose between Google and Opera for my non-free fast browser, I'll take Opera thank you. Let's figure out how to get this installed so you can check it out! First thing we'll need to do a web search to find some good info like this
http://wiki.debian.org/Opera
(this isn't optional reading if you are about to install Opera on Debian, please go read it now.)

Now that we know what we're up to let's get into a console and su to root. First step listed is to modify our sources.list, this is NOT a step to be taken lightly. Once we allow trusting to the Opera repository it opens up a security hole that could be exploited. Assuming that's not stopping you:
debian:/home/thom# geany /etc/apt/sources.list

That will open up Geany as root, then we can add these lines:
# This is just a comment, put whatever you want in here.
deb http://deb.opera.com/opera lenny non-free

We can click save in Geany and close it. Now just because we added that line to the sources.list file doesn't mean it's active yet, let's alert our OS to the change:
debian:/home/thom# aptitude update

Notice we get the same error as the example on the wiki link for their apt-update. Either way we need to add a gpg key to trust this source before we can use it.
debian:/home/thom# gpg --keyserver subkeys.pgp.net --recv-key 9D1A0061

We should see we have imported 1 key, we can take a look at it:
debian:/home/thom# gpg --fingerprint 9D1A0061

We can see it's from Opera and has some time before it expires. OK Now we actually need to establish the trust:
debian:/home/thom# gpg --armor --export 9D1A0061 | apt-key add -

And we see a little "OK" to be the only sign that we've now opened ourselves up to getting poisoned packages from Opera, but if you've made it this far you must know what you're doing right ;)

OK let's try that aptitude update again:
debian:/home/thom# aptitude update
Yeah that should be much happier now.

Now look at the next line in the wiki, "apt-get install opera" so remember that post about pick one package manager and use it exclusively? Well if we go all copy/paste happy here and install Opera via apt-get there will be no log of it or dependencies met in aptitude. So do the right thing:
debian:/home/thom# aptitude install opera

Now a couple exits will close out our su session and our xterm window, then we can pull up a menu and Applications -> Network -> Web Browsing -> Opera. If you accept the agreement click that and behold your new fast as hell browser! I'm not gonna get all application oriented but there are a few things you should do with Opera the first time you see it:
Speed Dial
  1. close the tab that welcomes you to Opera
  2. what you see now is the "speed dial" it's 9 websites you can pre configure
  3. right click on all of the ones that are set and clear them
  4. right click on one of them and choose edit
  5. type in thomslinuxblog.blogspot.com and click OK, it will prefetch the page
  6. since I only do about one post a week, right click set the reload to never (or whatever you want)

Widgets:
  1. once you are settled into the speed dial, click the menu Widget and then Add Widget
  2. you will see all of the Opera widgets, I don't use any widgets but if it's your thing you can knock yourself out

Email:
  1. click tools and choose email and chat
  2. choose OK to setup an account, choose email
  3. run through the wizard to setup your email, personally I only use imap
  4. see your email! If you have a large inbox or slow mail server it may take a little time to pull down headers

IRC:
  1. click tools and choose email and chat
  2. choose add to setup an account, choose chat
  3. run through your setup wizard, I'm doing my freenode/NA setup
  4. now say what room you want to hit, like #debian and in you go!

So how cool is Opera? We've got our speed dial setup, my blog in one tab, my email in another tab, and IRC up in yet another tab! That is freakin sweet and fast! All of this only burned 17Mb of disk space!















OK we'll save flash, java, sound, etc for later as we have other dependencies we'll need to take care of along the way. At least for now we can research how to make fluxbox not look like vomit! Next time we'll start the cleanup, I promise.

Thursday, February 4, 2010

Adding a text editor and a file manager

Now we've got some gui-ness going, but it looks like hell and that's just embarassing. To get fluxbox customized we're gonna need to navigate around our filesystem and edit a few text files. Now we can easily do that the badass way from the command line using ls, cd, and vi, but instead lets go ahead and fill out our graphical environment with a text editor and a file manager.

Once we've booted up, logged in, and done a "startx" to bring up fluxbox we can right click anywhere on the desktop to pull up a menu. Click Applications -> Terminal Emulators -> XTerm and viola we're back at a cli within our gui. Linux always seems to come back to this...

Now it's time to su to root to install a text editor and a file manager with aptitude. There are a billion different text editors and file managers, the ones below just happen to be my favorites right now so you can either fill in your own favorites (as long as they are in the Debian repos) or try these out for sport. We can install multiple packages with all dependencies by just putting them all in one line like this:
debian:/home/thom# aptitude install geany pcmanfm

After that we can type exit a few times to close out su and the XTerm session. The only price we need to pay for a great file manager and a great text editor is just a little disk space. Now if you right click on the desktop you'll see a few new items in the Applications menu.

  • Geany: we can try out Geany by clicking into that new menu item "Progamming" let's go ahead and open it up. I know I called it a text editor but technically it's an IDE, or Integrated Development Environment. If you type programming code into Geany it will recognize what it is and color code comments and alert you to open tags, etc. It can do LOTS of cool stuff, but it's also a heck of a nice text editor that can open many files in tabs for you to copy paste in and out of.
  • PCManFM: next let's take a look at that file manager, PCManFM is under our new File Management submenu. When we click it you'll see an error pop up saying that "GTK+ icon theme is not properly set" so we've got something to fix already! Click OK and take a peak at our app, notice the bottom bar where it says "... (XX hidden)" that's how many hidden files we don't see. If we click View and choose Show Hidden Files we'll see what's being hidden by the system. Look for a file named ".gtkrc-2.0" do you see it? If you saw that GTK+ icon error I'm guessing you don't. Lets go ahead and fix that.
  1. Right click on the right pane and Create New -> Empty File and name it EXACTLY ".gtkrc-2.0" and hit enter. You should now see that file in PCManFM.
  2. Right click the file and choose Open With Geany.
  3. In Geany type EXACTLY this "gtk-icon-theme-name="Raleigh"" I know putting double quotes inside of double quotes is bad form, get over your bad self.
  4. Save
  5. File -> Quit
  6. Close PCMamFM
Now we can open PCManFM without any errors!

OK, we're gonna follow this basic scheme to fix up lots of stuff in fluxbox. Boot up, login, start fluxbox, open PCManFM to browse to or create config files, then open them in Geany to modify and save. But what happens when we need to go to web pages to copy/paste out of? We'll get a real browser installed next time.

Monday, February 1, 2010

Loading up a lightweight GUI

I read a good thread a while back where someone stated Debian is where you end up with linux, not where you start. This makes sense to me, lots of people start up with Ubuntu or Suse or another well packaged distro, get their feet wet and find out they love linux, then start bumping into the limitations of the distro they are in and start hunting around. I think graphical environments seem to be a similar journey for many people.

Typically "newbie" distros default to full blown Gnome or KDE and they are both wonderful environments to work in, but many people feel they are too bloated. Don't get me wrong, I'll confess I've run both of them quite a bit over the years and I still run Gnome as the default on my primary laptop.

Taking one step away from the two huge environments we have XFCE. I ran Xubuntu 6.06 when it came out as my primary OS for about 6 months, and I've heard many people say XFCE is a wonderful balance between the niceties of a full graphical environment and the lightweight window managers we'll be discussing shortly. Because XFCE is all gtk under the hood it plays very well with Gnome utilities. If you are looking to take your first step out of Gnome or KDE and want to get your toes wet, XFCE is a great next step for many.

At the farthest end of the GUI spectrum from Gnome and KDE are a slough of basic window managers. People may have heard of these lesser known window managers, but people rarely seem to give them more than one boot before switching back to what they already know. It's true that there is curve to getting familiar with any of the lightweight window managers, but there was a big curve to switching to linux already and that was pretty rewarding wasn't it?

So over on the side of the blog there is a link for the old Linux Reality podcast, a few years back Chess did a few episodes about the differences between all the different window managers. I'd suggest going out and listening to them as they are great information and that podcast was very entertaining.

So bringing around our problem at hand, we have a pure CLI netinstall of Debian and I'd like a graphical envionment to run some apps I like. I've tried most wm's to hit the street over the last decade or so and I personally love fluxbox. It's not as skinny as some, it might be missing a feature from some other WM, but I really love the balance it holds. To me fluxbox is:
- well documented
- very mature
- highly customizable
- potentially beautiful
- very lightweight

You should try out a bunch of window managers, maybe you'll like icewm or rat poison better. For this little Debian box let's drop on some fluxbox to play with. We'll need to boot up and su to root, then we can run through the setup. First we need to get xorg, this is the package that any graphical environment will sit on top of:
debian:/home/thom# aptitude install xorg

That burns about 120Mb, but that's the cost of having a GUI. Next we will fetch fluxbox:
debian:/home/thom# aptitude install fluxbox

And that burns another 7Mb. First thing you'll notice is that you are still in the command line interface. Just because we've installed it doesn't tell linux we want to use it. Ain't that cool? If you are ready to experience the wonder of fluxbox, type exit to leave root and as your normal user launch X:
thom@test:~$ startx















... and BEHOLD! Oh wait, yeah it really doesn't look like anything. If a netinstall of Debian is a blank canvas of an operating system, fluxbox is a blank canvas of window manager. Go ahead and right click somewhere on the desktop, this is how you pull up a menu in fluxbox. Go ahead and poke around the menus and see whats in there. If you have the scrolling issue in the screenshot I've attached, click on the Configuration menu, choose Toolbar, and put the Placement at Top Center and you should be alright. At the bottom of the main menu you see "Exit" that just takes you back to the command line interface, click that and shutdown normally whenever you're ready.