MacBook+Linux, suomalaiset näppäimet

Moni muukin lienee huomannut, että MacBookista puuttuu se AltGr. Hakasulkujen ja piippujen etsimisessä meneekin pieni tovi. Mac OS X:ssä ne löytyvät Alt-napin takaa vähän hassuista paikoista, mutta löytyvät kuitenkin. Linuxissa asia ei ole näin hyvin ainakaan automaattisesti. Tarvittavat muutokset tehdään xorg.conf-tiedoston InputDevice-lohkoon, jossa määritetään näppäimistö.

Okei, pari vaihtoehtoa: Jos tykkää Mac OS X:n sijoitteluista, voi xorg.conf:ssa sanoa

Option "XkbModel "macbook79"

ja asia on sitä myöten selvä, joskaan ihan kaikkia erikoisnäppäimiä ei ole suomalaisittain odotetussa paikassa. Tämä vaihtoehto tekee oikean omppunapin oikealla olevan toisen enterin toimimaan AltGr-nappina, eli sillä saadaan ne erikoismerkit, jotka Mac OS X:ssä tulevat Altin takaa. (Huom: Voipi vaatia aika tuoreen Linuxin, mielellään Ubuntun, jossa tuo macbook79 on mukana.)

Jos tykkää normaalista suomalaisen näppäimistön sijoittelusta, voipi sanoa

Option "XkbModel" "pc105"
Option "XkbLayout" "fi"

jolloin kaikki toimii kuten norminäppiksessä, mutta tällöin näppäimistöstä puuttuu se AltGr. Harmillista. Tilanteen voi korjata lisäämällä toisen seuraavista riippuen siitä, haluaako AltGr:ksi oikean ompun, vaiko sen vieressä olevan turhake-enterin:

Option "XkbOptions" "lv3:rwin_switch"
Option "XkbOptions" "lv3:enter_switch"

From Linux to Mac: Days 5-7

I installed XiphQT to enable Ogg Vorbis, FLAC and other better than mp3 music formats. I also installed subversion using MacPorts so I can access my work files and other documents on my server. Subversion in combination with the sshfs allows for pretty good file sharing already, but I’ll need to look at nfs sharing still. SSHKeyChain is a good free piece of software to replace Linux’s ssh-agent, and a bit more.

Regarding iTunes, I also tested the podcasting and videocasting features of it. So far my podcasting has happened via a Linux server that downloads new entries from my feeds every night, and I just copy new stuff into my player when I’ve listened to everything in it. I don’t use the player for music, just for podcasts.

I stumbled upon another recent Mac convert, and his gripes about Mac. Good reading, especially the comments, where most of his problems are addressed. My main problem still is that a windowing system controlled by a mouse is just too clumsy and slow. I find myself spending much too much time just juggling the application windows around. So while Mac is definitely something I’d recommend to any normal computer user over a Windows machine (due to both usability and security issues), but the possibilities of tweaking the UI to match a power user’s needs just are insufficient, just as they are in Windows. The next release of Mac OS X should have virtual desktops, so that might help a bit. But I guess I’ll need to do a triple boot system with Linux and see how much of the hardware I can get to work in a pure Linux system.

Well, as I complained about this, my colleagues pointed out QuickSilver, which should allow me to do more using just the keyboard, and not having to bother with the mouse. Let’s install and see.

From Linux to Mac: Days 3-4

During the weekend I managed to start using iPhoto and iTunes. Very impressive pieces of software, I must say. No wonder so many people use iTunes. I did import most of my music and photo collections into the applications. There are some aspects where I’d like more control over how they operate, but I guess I’ll just try them out for a while.

I also installed MacFuse so I can mount files over ssh. Didn’t have time to test it out, though.

After some tweaking I also turned off FileVault – it was just too cumbersome to move files around, and with the ultra-slow (and ultra-secure, I guess) deletion logouts were a bit of a pain. After all, I do open source work, and publications, and such, so there are no classified secrets on my machine.

The Finnish keyboard layout is a bit of a hack. Important special characters needed in shells, like “|”, “@” or “$” were a bit difficult to find, but at least they are accessible. Special characters in file names are also a bit problematic. Apparently Mac uses UTF-8, but the Terminal, of course, cannot handle unicode. So I need to find another terminal for that.

Of course, the Ubuntu Linuxes I’ve installed work quite nicely. I’m starting to think that VMWare has handled Linux support better than Parallels. On the Windows side there isn’t much difference. I’ll post the details later when I’ve gone through all combinations extensively.

From Linux to Mac: Day 2

Restoring the contents of my previous laptop’s hard drive was a bit more complicated than I thought. I got a firewire/usb box I could stick the hard drive into, and Mac OS X easily showed the FAT partitions of the drive when I plugged it in using firewire. However, there was no way to make that firewire drive visible inside VMWare or Parallels to actually access the Linux partitions. An attempt with USB failed because USB doesn’t provide enough power to the drive, and of course the external power source was nowhere to be found, since “firewire is superior”. OK, today I got a new box with two USB connections, one to just provide extra power. Excellent! Now when I plugged it in, Mac OS X showed me the FAT partitions. I unmounted them (dragging them to Trash, which currently is clever enough to look like an eject button when you’re dragging a drive into it), then in the settings of my VMWare’d Ubuntu, selected the USB drive and checked “connect”. Click on Apply, and lo and behold, Ubuntu started mounting the partitions and opening them for me.

OK, nearly there. However, I was using LVM2 on most of the partitions, so I needed something else. Specifically this:
vgscan
lvmscan
vgchange -a y

Then I could just mount all of my logical volumes, and start moving the data to my new laptop.

Meanwhile, I installed NeoOffice, Transmission and Kiiboard. KeyJNote is distributed in source form, so I’m still figuring that out – seems I need to install quite a bit of Python using MacPorts.

From Linux to Mac: Day 1

I’ve been a happy penguin for years now, but my personal laptop (Asus M3000N) died last thursday. Took it for a checkup, and the motherboard is busted. It’s nearly 3 years old, so no point in getting it fixed. Happily, I was promised a new laptop by my employer, MediaLab of UIAH. MediaLab is full of designers and new media professionals, and virtually everyone here uses a Mac. So I was given a brand new MacBook: 2.16GHz, 2GB, 140GB, DVD-RW, WLAN, Bluetooth, IR remote, iSight, and the works.

Obviously, since I’ve worked for years on Linux using ion, I wasn’t going to be very happy with a track pad and a conventional windowing environment, even if it was designed by people who understand something about usability. So my first tasks were to build ways of running Linux on the machine.

What I’ve seen of Macs, they have remarkable energy saving capabilities, plus they plug into practically any peripherals out there. So I figured that at least for now, I’d be happy running Mac OS X natively, and then Linux as my working GUI in a virtual machine. So I went ahead and downloaded and installed the preview versions of both VMWare and Parallels.

Here are the tips I got from experienced Mac users at MediaLab:

  • Do not pay for a .mac account, but get the free account anyway. That way you’ll get an account for iChat, and it doesn’t matter that the .mac account expires in 60 days.
  • Use two fingers on the track pad to scroll.
  • Get a developer account at connect.apple.com. It will allow you to download XCode and other beta and preview software. And you should install XCode and MacPorts, which will allow installation of POSIX software onto the Mac.
  • For installing software, remember to drag-and-drop.

The last piece of advice was maybe the most important one. Basically most Mac software comes in a dmg file, which is a disk image. It will be mounted automatically if you use Safari, and it will usually contain an icon of the software, plus some graphics that apparently are meant to tell you that you should drag the icon into your Applications folder. Right. Well, the first application that I happened to download had some extra magic in it, so it was enough to just drag the icon on top of an installation action to the right of it. This confused me quite a bit, since no other software did that – they had similar graphics with arrows and symbols, but nothing happened no matter where in the area I dragged the icon. Double-clicking on the icon just ran the software, so it wasn’t immediately apparent whether or not the software was installed. OK, so here are the different installation scenarios:

  • dmg with a drag’n'drop application icon in it: either run it directly to evaluate it, or drag’n'drop it to Applications
  • dmg with pkg in it, or a pkg file: double-click the pkg, it will run an installation wizard. Just keep pressing Continue.
  • zip file: it will open semi-automatically, and usually contains a pkg file (double-click that) or a simple application that you drag’n'drop onto Applications
  • tar.gz file: will contain source code for a program – no idea how to handle this, yet.

Well, I managed to install Firefox, VMWare Fusion Beta, Parallels for Mac, OnyX, XCode Tools and MacPorts. I also installed both Ubuntu and Windows XP Professional onto both of the virtual machines, so I can start testing how they perform.

At the end of the day, I installed BootCamp which allowed me to repartition the hard drive and make room for Windows XP. I might be able to use that space for a stand-alone Linux later on.

The final challenge for the day was getting the data from my old laptop’s hard drive, which I’ll write about tomorrow.