Sunday, December 7, 2008

Compiz-Fusion: Some basic commands

So, it dawned on me the other day while I was watching a colleague zoom through windows and workspaces with keystrokes that I am not using all the juicy goodness of my desktop GUI. Compiz-fusion is installed by default on Ubuntu 8.10, but I'd never bothered to figure out how to use it properly. So, today I'm learning a bit and writing in commands I find here.

First, a definition. The super key is the Windows key on Windows keyboards. I have not the foggiest notion what it would be on other keyboards.

Next, make sure that you have the compiz config settings manager (aka CCSM). It should be under preferences and it doesn't need sudo acces to run. If you don't have it (I didn't even though I did have compiz-fusion installed) then do this:
sudo apt-get install compizconfig-settings-manager

If you go into CCSM and then choose General Options, and then choose the tab for key bindings, you'll get a listing of all the default key bindings. You can change them there, if you like.

For quick reference, here are some of the defaults I find useful.









Close window   alt-F4
Show Main Menu   alt-F1 (use arrows to navigate, esc to escape)
Run Dialog   alt-F (for apps that may not have a handy-dandy menu link)
Unmaximize window   alt-F5
Minimize window   alt-F9
Maximize window   alt-F10
Window menu   alt-space
Show desktop   ctrl-alt-d


Expo:
See all the Worspaces at once: super-E
Use the arrow keys to navigate around. Use Enter to exit that view and go into the workspace you have highlighted.

Ring Switcher:
This gives you a view kind of like when you flip through CD and DVD covers on iTunes, only the view is of your available windows.
Clockwise rotation: super-tab
Counter-clockwise rotation: super-shift-tab
Let go to land on the window you see in the center of the screen.

Scale:
This is the tool that has Exposition-like effects. Your desktop turns into a rotatable cube.
ctrl-alt + left and right arrows turns the cube.
ctrl-alt-down arrow flattens the cube.


There's a lot more that you can do, but those are the bits that I've played with so far and liked enough to keep activated. I like the water effects, but they are a bit distracting.

I like the annotation tool, but don't really need it on this computer. It would be way cool for presentations, though, so check it out if you do sales presentations, tech-talks or are a teacher.

Have fun with it!

edit: yes, yes, I see the big gaping hole in the view before the table. I'll fix it later, sorry!!

Thursday, December 4, 2008

When to write a script in a language you don't know

Sometimes there is a long, repetitive task that you know would be much better off if done by a small script, but the problem is that you don't know how to use the tools available at the moment.

One of my problems is that I never remember anything about a language or system if I'm not using it often. It's like I do a brain dump in order to make room for new stuff when I switch from one technology to the next. That means that even though I *have* done considerable shell scripting in the past, I can't remember a darn thing when I need it for a one off project. So, I know that I'd be better off writing a script, but I end up doing the job by hand anyway because it would take longer to look up language bits than it does to hit arrow up, back, back, back,... delete, delete,... paste.... a few times through.

The whole time I'm doing that, though, I'm thinking, "I could solve this like this in PHP or like that in Perl" and none of it matters, because at the moment I'm working in a very limited embedded linux system with neither of those languages on board.

So, what do YOU do in a case like that? Do you go look up the language ref for what IS available to you, even if it will take longer than the cut-and-paste for the task? Or do you just do the task manually?

Friday, November 28, 2008

Nvidia controls aren't in the GUI menus

My computer at home has an Nvidia graphics card, and it's running Ubuntu 8.10 at the moment. We have the living room set up as a combo family room/dining room/play space/study/office with an open layout and furniture sort of compartmentalizing the areas for each usage. We do not have cable TV, but we do have a nice TV/computer monitor that we watch movies and YouTube videos on. We pipe in all video content from the computer, whether it's from a DVD or from the Net. In order to make that work, we have the TV monitor set up as a secondary monitor plugged into the video card.

The problem: There was no GUI menu item for the Nvidia driver settings. The display settings that System->Preferences->ScreenResolution gives aren't the right thing at all.

The solution: You *may* have a link in System->Administration for Nvidia X-Server settings. If so, that's what you want. If not, open up a terminal window and type

gksudo nvidia-settings


It will ask you for your password, and then you can set up the secondary monitor as you like.

If you want to make that a selection in the System->Administration menu, right click on the word "System" in the top panel, then choose "edit menus". From there you can add a menu item for the above command.

Thursday, November 20, 2008

Bash Readline Commands

One of the cool things about most versions of the Linux command line is that you get a built in text editor to allow you to move around and edit your line easily. I generally use the Bash shell, and that comes with Readline. I know a few commands by heart and use them constantly, but there are more that never quite stick in my head. So, I figured I'd write about them here so they'd be easy to find and, possibly, pressed a little more firmly into my gray matter by virtue of having written them down.

Ctrl-e Go to the end of the line
Ctrl-a Go to the start of the line
Alt-f Go forward one word (actually Meta-f, but Meta is usually Alt)
Alt-b Go backward one word


Ctrl-k Kill the text from the current cursor point to the end of the line
Alt-d Kill the text from the current cursor to the end of the word
Alt-DEL Kill the text from the current cursor to the start of the word
Ctrl-w Kill the text from the current cursor to the previous white space
Alt-DEL and Ctrl-w are different because the "word boundaries" are different. Alt-DEL will stop at punctuation and other non-word characters. Ctrl-w does not.
Ctrl-y Yank (paste) the most recently killed text into place at the current cursor


Ctrl-l Clear the screen, putting the current line at the top

Sunday, October 19, 2008

Wireless connection from the command line

If ever you find yourself stuck with a *Nix box that won't boot into any kind of comfy graphical interface, and you need to connect to a wireless internet connection so that you can look stuff up and maybe solve your problem, here's a helpful tip:

There is a wireless networking utility very much like ifconfig called iwconfig. When you have a chance (and preferably before you really need it) check out the man page for it. Here are some quick and dirty instructions, in case you are desperate right now.

To find out what wireless networks are available to you, type
iwconfig wlan0 scan (see comments)
iwlist wlan0 scan

To attach to an open, non-encrypted network, type
iwconfig wlan0 essid netname
where netname is the essid of the network you want to connect to.

If you only have encrypted networks available, you might be in a bit more trouble. I haven't actually managed to get that working at all yet, though theoretically, it should work something like this:
iwconfig wlan0 key s:password
iwconfig wlan0 essid netname

where password is your password and netname is the essid of the network you want. The s: means that the password is in string format. If you know the hex version of your password, then instead of saying s:password you'd just type in the hex of the password like this:
iwconfig wlan0 key 0123-4567-89

Good luck getting your GUI fixed!

Sunday, October 12, 2008

Stealing from Ubuntu to pay Midinux

I'm busy trying to get an application to work on Midinux MID devices. There's a problem, though, because a chunk of libraries that I need are not available in Midinux for some reason. So, I'm snagging the libraries I need from the Ubuntu os I'm running on my desktop and converting them to run on the MIDs with Midinux. I can do this because, for reasons I don't understand at all, Midinux is compiled as an i386 system even though it's sitting on a Mobile Internet Device with an Atom CPU (that's lpia architecture, in case you didn't know).

You can find lots of debs (those that you have installed on your Ubuntu desktop, that is) in /var/cache/apt/archives/ . The advantage of that is that you don't have to go hunting very far. If you can't find the deb that you are looking for there, try searching http://packages.ubuntu.com

Once you have the packages that you need, go ahead and change the debs into rpms using Alien. The command looks like this:
> alien --to-rpm the-package.whatever.deb

With that done, stick the package someplace where you can download it to your Midinux device, then pop over into the X-Terminal and into the directory where the rpm you need to install is sitting. Install the rpm with:
> rpm --install the-package-whatever.rpm

And there you go!

Tuesday, October 7, 2008

Ahhhh... This place has PACKAGES

Having gotten my blasted scratchbox working, I didn't seem to be any closer to compiling anything. I needed several packages and they weren't in the default packages available in the initial set up. Why, o why don't they give you any useful repositories right from the start in your scratchbox setup? I mean, COMEON!

So, the good news is that Hacking the N810 pointed me in the direction of http://gronmayer.com/it which is now officially my second savior of the day (right after Gnuton).

At Gronmayer.com I was able to search for the packages I was looking for, find out what repositories they live in and set up my /etc/apt/sources.list in the scratchbox accordingly.

Just remember, you have to set up configuration files like the /etc/apt/sources.list for EACH target you are running in scratchbox, especially if you plan to be doing cross compilation.