August 21, 2008

Updating some Pages

I have decided to update a few of the pages, especially the how-tos, to make them easier to use, and easier for me to keep updated. This is an on-going process currently, but it may mean that some of the URLs have or will change. If your bookmark stops working, please update it. I haven’t deleted the page, just changed it!

Thanks for your patience,

Lusule

August 18, 2008

How To: Embedding Terminals in Linux

I’ve already pointed out a couple of places where Gnome-users can get good information on creating Embedded terminals, but I haven’t been able to find a good guide to do the same thing in Fluxbox.

It’s actually quite easy, once you know how. Which is, of course, the trick. Here I will explain the process for others who want to achieve the same look.

Setting up the Window

Start by opening a terminal, sizing it to the right dimensions, and placing it where you want it to be.

Next go to File and select New Profile. Choose a distinctive name, and go to the profile config window.

Here, you can configure your terminal to have the no-trimmings look we’re going for.

  • On the ‘general’ tab, unselect ’system fixed width font’ and choose your own if you wish. Untick ‘Show menubar by default in new terminals’.
  • Under ‘Title and Command’ change ‘Dynamically-set title’ to ‘isn’t displayed’.
  • Change colours to whatever seems suitable. I have a light background, so I prefer a darker text color.
  • Effects dictates the background for your terminal. In this case, we want a transparent background, so tick that and set shade to none. You can also choose to display any image file as a background.
  • In the ‘Scrolling’ tab, set ‘Scrollbar is’ to ‘disabled’. Increase the scrollback lines if necessary.

We can ignore the Compatability tab so close the window.

Right click on the terminal and choose ‘change profile’. Change it to your new profile.

The App File

Now we need to set up our auto-start settings, and get rid of the decorations.

Open up ~/.fluxbox/apps in your favourite editor. You don’t need sudo, as it’s in your home directory.

The apps file is where you set the properties for windows and applications that you want to open in a particular way. You can define the properties for all instances of an application, for set number of instances, or for windows with a particular title. You can find more information about the apps file, and how to use it, here.

Our terminal now has it’s own title, the name of the profile you created. Any terminal with the same profile will have the same title, but terminals with other profiles, or the default profile, will not. Lets say we called our profile termie.

  1. First we need to find the dimensions for our terminal. To do this, type xwininfo in a terminal, and click on the window you want information about (in this case, our terminal). This will bring up a long list of stats. Put it to one side to refer to.
  2. Now copy the following into your apps file:
    [app] (title=termie) {1}
    [Dimensions] {538 274}
    [Position] (UPPERLEFT) {0 0}
    [Layer] {12}
    [IconHidden] {yes}
    [Deco] {NONE}
    [Sticky] {yes}
    [end]

    • Replace termie with the name of your profile.
    • Dimensions are in {width height} format. Get your width and height from the xwininfo.
    • This position will place the window right in the upper left corner. You can choose from WINCENTER, CENTRE, UPPERLEFT, UPPERRIGHT, LOWERLEFTLOWERRIGHT. You then state how far from that position your window is in x-y co-ordinates. If you leave your position as ‘UPPERLEFT’ then you can find the appropriate co-ordinates in xwininfo, as the Absolute upper-left X: and Absolute upper-left Y:.
    • Layer {12} states that the window will be part of the desktop layer.
    • IconHidden determines whether or not the program shows up on your taskbar.
    • Deco {None} gets rid of all the window decorations, leaving just the window contents.
    • Sticky {yes} shows the terminal on all workspaces, not just the current one, so when you switch workspace, it’s still there.
  3. Save the file when you’re happy with the settings, and open your startup file at ~/.fluxbox/startup
    • If you followed the guides, you will already have various programs listed in here that you want to start on reboot. For example I have conky and emesene auto-starting. Now we’re going to add our terminal.
    • In the same section as the other startup programs, add this line:
    • gnome-terminal –window-with-profile=termie &
    • Change ‘termie’ to the name of your profile.
    • It may be that you want your embedded terminal to automatically run a particular command on startup. For example, I have a terminal that automatically runs IRSSI. To do that, edit your startup command to look like this:

      gnome-terminal --window-with-profile=termie --command=irssi &
  4. Save the file when you’re happy with it, and close the terminal.
  5. Now try rebooting, to see if it worked!

August 17, 2008

Setting up Fluxbox

I’ve been threatening to try Fluxbox for a while, as the Gnome panel, and the fact that you can’t remove it, really annoys me. A lot of people complain about losing Compiz if they switch, but I have most Compiz options turned off. The only aspect of Compiz that I think is truly interesting is the transparency, and Fluxbox has fake-transparency built in so it does for my needs.

Where to find Guides

This isn’t going to be a how-to for installing Fluxbox from Ubuntu, as there are already some good ones out there: This excellent guide on the Ubuntu Community Docs website, and this guide by LinuxOwns are good places to start. The Fluxbox HomePage is a handy stop, and the Wiki is also a great source of information. If the worst comes to the worst and you just can’t figure it out, you can get help at the IRC #Fluxbox channel on Freenode.

A few Problems I ran Into

Gnome Desktop Control

I followed the Ubuntu guide without too many problems, but I did run into a couple of things of interest. Firstly, one of the first things I did was try to open up Nautilus to see how that looked. Don’t do that, at least, not through the main Application menu. Nautilus has some gnome-based features that basically take control of your desktop, which can cause a few problems. You can bypass this by running nautilus –no-desktop in a terminal, but there is a handy way to bypass these sorts of problems with Gnome apps on the Ubuntu guide here. I just pasted this small section in my ~/.fluxbox/startup script before the section to start Fluxbox.


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

Once I had that in my startup config, I had no more problems with Gnome trying to reassert authority.

‘Suggested Packages’

After I finished the guide I made sure my Conky worked, and it didn’t. The reason for this was that I had followed the package manager’s advice and installed its suggested packages with Fluxbox: fbdesk, fbpager, and fluxconf. TIP: Don’t do this!

  • I’m told that fluxconf causes all sorts of difficulties with configuration settings that can really mess the system up. It’s supposed to make it easier to configure Fluxbox. Luckily I had not yet used it, so I just uninstalled it.
  • FBDesk was what was causing my Conky problems. It allows you to place icons on the desktop, which interferes with Conky, and shouldn’t really be necessary any in my opinion, as Fluxbox has much neater ways of organising the desktop, without clutter. I uninstalled that too.
  • I was not aware of any problems with FBPager, but I’ve been told it has been superceded by other things, and I wasn’t using it anyway. For good measure, I uninstalled that one too.

Missing Toolbars

My next problem was a bit, well, noobish. I was having trouble finding windows I’d minimized. I was able to make a key combination in the ~/.fluxbox/keys configuration file like this:


Mod4 Up :ToggleCmd {ShowDesktop} {Deiconify allworkspace originquiet}

This creates a toggle that minimises all the windows on your desktop, then returns them again, when you press <win-up>. It still didn’t return windows I’d minimised to the system-tray, though. I was advised to just ‘use the taskbar’, but what taskbar?

It turns out that there is a taskbar in Fluxbox, and I had accidentally hidden it. An instinctive reaction – see a taskbar, find a way to get rid of it. And in the case of Fluxbox, this is very easy. Just right click on it, and select ‘visible‘. The problem then becomes, how do you get it back again?

This is actually very easy too. Right click anywhere on the desktop to get the root menu, then Configuration>ToolBar>Visible. I felt very silly after that was pointed out to me!

Transparency

One of the things that attracted me to Fluxbox (I’m a sucker for Eye-candy) was screenshots of translucent menus. This is actually done with ‘fake transparency’, which means that a picture of the relevant part of your desktop background is basically pasted onto the menu. It still looks good though!

It’s easy to setup. From the Root menu, select Configuration>Transparency. Make sure Force Pseudo-Transparency is enabled, then adjust the Alphas for the relevant elements you’re interested in. The main one is probably Menu Alpha. Click the left mouse-button to reduce the Alpha, and the right mouse-button to increase it. The lower it is, the more ’see-through’ the menus will be.

Keyboard Layouts

Another problem I had was with keyboards. LinuxOwns mentions how to make sure the correct keyboard layout always loads on startup, from within the xorg.conf file. Open /etc/X11/xorg.conf in your favourite editor, using sudo. Find the section with:


Section “InputDevice”
Identifier “Keyboard01″ #or something similar
#etcetera – they may be more below, there wasn’t on mine.

Look for a line like the one below, if it’s there, or put it in this section, if it isn’t:

Option "XkbLayout" "<your-layout-here>"

LinuxOwns tells us that you can use “be” for the azerty, or “us” for the american layout. My problem was that I have an English keyboard, so I need the UK layout. However, the code is not, as many often use, “uk”, but instead it is “gb”. So I need my line to read:

Option "XkbLayout" "<gb>"

Embedded Terminals

Once I’d finally got the code right, my keyboard worked properly again. Without it, I had no <win> key, and had been unable to use my keyboard shortcuts.

Finally, I having set up my keys, my startup apps, my icons, my theme, my desktop background, and my Conky, (never forget the Conky!) I set about trying to work out how to create my beloved Embedded terminals. You can do it all from within Fluxbox, through the config files, without having to resort to extras such as Compiz (you can’t run Compiz in Fluxbox.) It took a bit of fiddling to work out how to do it, as I couldn’t find a clear How-To, as there is for Gnome. However, I have finally achieved something that (I think) works, and I will write my own how-to about it later.

August 16, 2008

Customising GTK

Since I seem to be on the ‘gnome customisation’ band-wagon at the moment, I thought I would look into trying to make my own GTK+ 2.0 themes, along the lines of some of the excellent ones I’ve found at places like this.

For those of you eagerly anticipating a nice clear ‘How-To’ on the subject, I’m afraid I was defeated. If you are interested in making your own theme, then the Gnome Wiki has a tutorial here, which is probably best combined with simply going into the directory of a nice simple theme you like and having a look at the gtkrc file.

I decided that this degree of customisation was a little too difficult still at this point in my Linux education, so I started looking for alternatives. I found some fantastic examples of the sort of things I could do here but sadly very little explanation on how to do them myself.

Just as I was about to give up, I was thrown a lifeline of hope by another IRC friend.

The Gnome Color Chooser

The Gnome Color Chooser

Gnome-Color-Chooser is a GTK theming application, available for download off the Ubuntu Repositories. It doesn’t modify your existing theme at all, but simply super-imposes it’s own theme on top through a ‘tick box’ system. Simply untick the boxes, and you have your original theme back as good as new. Only tick some of the boxes, and you end up with a combination of your existing theme and Gnome-Color-Chooser’s additions.

It’s very easy to lose a lot of time to playing with this app, so to help you along, I found a couple of other tools which are quite useful.

  • ‘The Widget Factory’ can be installed from the Ubuntu Repositories. It is, quite simply, an application that creates a window full of widgets, so that you can see exactly what your new theme will look like. It can show your current theme, or any of the themes that you have currently installed, without you having to set them in Appearance properties.
  • This website provides a very good color picker, which is very handy with all those color options to choose from in Gnome-Color-Chooser!

I’m still looking into ways to create a proper GTK+ 2.0 theme, and any pointers are appreciated. For the moment though, this will leave me enough to be going on with, I think. I hope it helps you as well!

August 16, 2008

How To: Using Gmail with Alpine

I’ve tried a few of the different GUI clients out there, and I tend to find them to be almost as slow and bloated as Microsoft’s infamous Outlook. The main clients are Mozilla’s Thunderbird and Gnome’s Evolution.

In search of speedier email access, I decided to go searching for a command-line solution. My Conky tells me when I have new mail, and at that point I want to be able to quickly open a client, look at the email, and close it again, without having to wait for the client to load up and then pack itself away again after. I also don’t want to have to leave the client open all the time.

Since I use Gmail, the best solution is for me to find a client that can use the IMAP protocol. As far as I can tell, this comes down to two options: Mutt or Alpine, the successor to the old Pine client. I tried Mutt, but I found it difficult to configure, especially considering I want access to all of my accounts, not just one, or one pooled inbox accepting mail from all of them.

That leaves Alpine, and to be honest, I’m quite happy with that. Alpine seems to do everything I need it to do, with relative ease. If you’re using Ubuntu, you can download and install it from the repository. Otherwise, you can find the latest version here.

The following guide just gives a basic rundown of how to set up Alpine for multiple gmail accounts. It assumes you are not also using a local mail server. For more detail on working with Alpine, you should see this excellent in-depth reference website.

Retrieving your INBOX

The first thing to worry about is how to set up Alpine so you can read your Gmail.

  • Once you’ve installed Alpine, run it by typing alpine at the command prompt. Then type go to Main>Setup>collectionLists>Add. In each case, you can get to the menu by just typing the letter I’ve highlighted in bold.
  • Fill in the options like this:


    Nickname : <choose a nickname>
    Server : imap.gmail.com/ssl/user=username@gmail.com
    Path :
    View :

    You can leave path and view blank.

  • Press <ctrl-x> to save your settings, and then go back to the collectionList and choose to Add as many different accounts as you wish. Press ‘E’ to exit the collectionList menu
  • There are a couple of configuration options you will want to change.
    • Go to Main Menu>Configuration and scroll down until you find the [Advanced User Preferences] section. Mark Save will Not Delete toward the end of that section.
    • Next go to Pruning Rule and choose don’t rename, don’t delete.
  • Hit ‘E’ to Exit setup, and choose yes to keep the settings.
  • To read your mails, go to the Main menu and choose ‘Folder List’. Hit ‘Enter’ to choose the folder you wish to look at, put in the password if necessary, and use ‘>’ and ‘<’ to go back and forward between your folders to read your mails.

Sending mails through Gmail

To have the option of sending mails from different accounts, you need to use a feature called ‘Roles’.

  • Choose Setup>Rules, and type ‘R’ to choose ‘Roles’. ‘Add’ a new role.
  • Press ‘Enter’ to type in a nickname of your choice.
  • Under Current Folder Type go down to Specific and choose that.
  • Then go just below that to Folder List and press ‘T‘. You may need to input the password for your current folder. You can then navigate around the folder list and choose the folder that you want that Role to apply to. For example, if you’re looking at the inbox for account foo you want to send emails from foo. If you’re looking at account bar then that’s the account you want to send from too.
  • Now scroll all the way down to the section titled ACTIONS BEGIN HERE. Set the Set From field to the relevant account, eg ‘Foo Bar <foo.bar@gmail.com>. Then set Use SMTP Server to the following:

    smtp.gmail.com/tls/user=username@gmail.com

  • Finally set Compose Use = to ‘With confirmation’. Hit ‘E’ to exit and save changes. Add a new role for each gmail account.