Macbook Fn hotkeys with DWM

Every since I started using DWM (I suspect I will post about this later), I’ve been looking for ways to minimize dependence on external programs, such as dmenu or conky. Getting rid of pommed is another thing, because I don’t need many of the functionalities that pommed have. All I need is to map a couple of function keys to useful applications. Here I will just give an example on how to map the previous, next, and play/pause button on macbooks (F7, F9, and F8 respectively). To do this in DWM, you need to edit config.h as such:

#include <X11/XF86keysym.h>
 
static const char *mpdprev[] = {"ncmpcpp", "prev", NULL };
static const char *mpdtoggle[] = {"ncmpcpp", "toggle", NULL };
static const char *mpdnext[] = {"ncmpcpp", "next", NULL };
 
static Key keys[] = {
   ...
   { 0,     XF86XK_AudioPrev,          spawn, {.v = mpdprev } },
   { 0,     XF86XK_AudioPlay,          spawn, {.v = mpdtoggle } },
   { 0,     XF86XK_AudioNext,          spawn, {.v = mpdnext } },
}

Using this method, I can now use function keys to brighten/darken LCD screen, control MPD, turn volume up/down, and eject cd’s!

Fan control on Macbook

One thing that is not working very well on Macbooks is the fan control. On top of the machine running warmer than under OS-X, the fans don’t kick in until it’s very hot.

To remedy this, you can write a program to do this. I got a source code of existing package called cmp-daemon (http://aur.archlinux.org/packages.php?ID=21391) and tailored it to my machine (The fan RPM is a linear function of CPU temperature, but you might want to change it to step function, for example).

The set-up is pretty simple. There is the source code cmp-daemon.c, and a bash script to start|stop|restart the daemon: cmp-daemon.sh (see attachments). Just follow these steps:

  1. Edit cmp-daemon.c to your liking
  2. Compile:
    $ gcc -Wall cmp-daemon.c -o cmp-daemon
  3. Copy the compiled program:
    # cp cmp-daemon /usr/sbin/
  4. Copy the daemon script (make sure it is executable):
    # cp cmp-daemon.sh /etc/rc.d/cmp-daemon
  5. Start daemon:
    # /etc/rc.d/cmp-daemon start

    or edit /etc/rc.conf:

    DAEMONS=(.. cmp-daemon ..)

Attachments:
cmp-daemon.c (Download):
cmp-daemon.sh (Download):

Arch on Macbook

I installed Arch linux on my macbook (dual boot with Snow Leopard, I dedicated 45GB to Arch with 5GB Swap).

A small hiccup so far, but things are working out so far. I still need to set up a few more things, but basic things are set up now. I think I will write up a wiki page once I am happy with everything.

Also, I found out that my macbook’s generation is Macbook4,2 (Late 2008 model) through wikipedia.

Arch cycling jersey

As an Arch linux user and a cyclist, I couldn’t help but to notice a thread started by a user Chokkan about custom-designed Arch linux cycling jersey. The design is truly great and it’s definitely something I can wear for every ride.

Here’s the design:

Arch cycling jersey

If you want to have an input to the design or if you are interested, just follow the forum thread (link provided above).

Screenshots II

CPU&Heatsink in Laptops

The laptop (ze5600) has been running hot and stays hot even with the fan full blast. I figured it was the dust, so I wanted to clean it out  in the fan system  (it had never been cleaned). I found the service manual for the laptop, and decided to follow it to do it myself.

Of course being the first time opening a laptop, I was trying to be as careful as possible, but not everything goes smoothly the first time. It turns out that the original thermo paste completely glued the CPU and the thermal sink together. I had no idea what to do, so I took it to the local shop and the guy just plied it open with a small screw driver.

So after I got home, I just scraped off the old paste, cleaned it using isopropyl alcohol, and reapplied the new thermo paste (Arctic Cooling MX-2), and put it all back together.

The laptop works great, the fan goes off when the temperature rises, it actually cools the CPU, then turns off when it’s cool enough. Mission accomplished in my books

Continue reading ‘CPU&Heatsink in Laptops’ »

Screenshots I

Bootchart

This is the bootchart for my HP desktop:
bootchart3
Continue reading ‘Bootchart’ »

My Current Arch Systems

Here are the systems I have Arch Linux installed and running. In this blog I will be posting things that I learnt from these systems, so it would be good to introduce them.

Desktop:

HP Pavilion 505n

This is the computer that I got when I got into my university in 2003 (so seven years old now). It still runs great, and aside from graphics card and ram upgrades, nothing has been changed. I only have Arch Linux installed on it (single boot).

  • Intel Celeron 2.20 GHz
  • 512MB RAM
  • 60GB Hard Drive
  • Intel 82801DB-ICH4 Sound Card
  • NVIDIA GeForce FX5500 Graphics Card
  • Samsung 713N Monitor. 1280×1024 @ 60Hz
  • Realtek RTL 8139 Ethernet

Continue reading ‘My Current Arch Systems’ »