08 April 2009

X on FreeBSD amd64

I've gotten an amd64 desktop and started running FreeBSD/amd64 on it. I've had an amd64 capable machine before, but chose to run the i386 version of FreeBSD on it so I could use Nvidia drivers and have hardware accelerated graphics. (I think the linux flash player only runs on i386 too, but am not sure.)

So, I installed without issue. I included X in the installation and it worked fine. But, as I often do on new machines, I updated the ports tree and then began to install everything else I wanted and upgrade what I had there already, including X.

Then X wouldn't start correctly anymore. I had run it the first time without creating any config file. But, now it really wasn't happy. It would kind of hang, pointer wouldn't move and even <Ctrl>-<Alt>-<Backspace> wasn't working. (But, the computer wasn't hung. <Ctrl>-<Alt>-<Delete> still worked!) So, I created a config file (using one of those utilities, maybe 'x86config'). Still didn't work right. Then I started the process of changing different, random stuff in the config file to see if it would start working. It wouldn't.

So, I resorted to Go0gle, something I should have done alot sooner. I found this config file out there and it helped solve the problem pretty quickly. These two options in the "Server Layout" section did the trick:
Option "AllowEmptyInput" "false"
Option "AIGLX" "true"

Well, the "...EmptyInput" option rings a bell. :/ I don't really know much more. Is this a quirk of the amd64 platform? (But, if so, why did the release packages work without a config file?) Is this a quirk of the newer version of X?

Answers are hard to find when it comes to X. Be happy with a working config file.

Labels:

17 July 2008

xterm select/cut characters

I often use Eterm as my terminal. But, it's a little bit heavy and sometimes I use xterm too. Thing is, xterm is not user friendly and the defaults you get by starting it without options are just horrible.

Now, the basic, cosmetic options for xterm are pretty straight-forward. Also, it's usually good to specify '-ls' to make it a login shell. So:
xterm -ls -bg black -fg yellow -g 120x60

will give you a much nicer looking xterm, and bigger too. Green and cyan also make great foreground colors on the black background.

What really drives me crazy about the default xterm though is the way it selects/cuts text when you double click on something. I often have to do a lot of selecting and pasting and the default just divides on nearly every non-alpha character. There is a solution to that, but it's somewhat involved. I'm going to give you the short story here and tell you how to customize it further. (If you want the long story, try "man xterm".)

This is what I'm using:
xterm -ls -bg black -fg yellow -cc 42:48,45-47:48,126:48 -g 120x60

That takes the characters '*', '-', '.', '/', and '~' and makes them part of character class 48, which already includes all alpha-numeric characters and the underscore character.

Now, if you wanted to add other characters to class 48 so that they'll be included in your double-click selects, you just need to find out the ascii code for those characters and add them to your list. You can find the ascii codes from "man ascii". Use the decimal set.

For example, let's say I wanted to add '=', '?', and '@' to my list of characters to be included in selects. I check the ascii man page and find that their codes are 61, 63, and 64, then I'd add them to the character class list like this:
42:48,45-47:48,61:48,63-64:48,126:48

<ctrl-d>

Labels: ,

24 February 2007

Enabling your mouse scroll wheel in X

This is a quick tip. It's been around for a while and I'm not even sure where I first saw it. But, if you have a mouse with a roller wheel, you can add this one line option to your X configuration file to enable it. You'll then be able to use it to scroll up and down in your web browser, terminal windows, pretty much any program that has an "up" and "down."

I'm using xorg on my systems now, but I believe the scroll-wheel option was exactly the same in XFree86. In the block for you mouse, which typically looks like this:
Section "InputDevice"
Identifier "Mouse1"
Driver "mouse"
Option "Device" "/dev/sysmouse"
... just add one more line like this:
Option "ZAxisMapping" "4 5"
... restart X and you should be in business.


Whenever the subject is mice, I like to "give the devil his due" and admit that I use
M!cros0ft mice almost exclusively. That's one thing they've always done right. Software, not so much. :) But, a good, plain, optical mouse with a scroll wheel is hard to beat.

Labels: ,