Jaunty notifications on Arch Linux

The upcoming Ubuntu (codenamed Jaunty Jackalope) 9.04 has a new notification system. Since it’s so beautiful, you may wonder if it’s possible to get that stuff onto your Arch box. Here’s how:

  • Install notify-osd-bzr from Hugo Doria‘s repository. You can enable the repository by putting these lines at the top of your pacman.conf:
    [archlinuxbr]
    Server = http://repo.archlinux-br.org/i686/
    

    For those of you on 64-bit you can install the notify-osd-bzr package from AUR.

  • notify-osd shows dialogs for notifications with actions which looks quite ugly. So quite a few applications have to be patched to remove actions for notifications wherever possible. Patched versions of some applications can be found in AUR. Some of these are also available from the archlinuxbr repository.
  • Install human-icon-theme from AUR and use it to get the icons in gnome-power-manager and networkmanager notifications (unfortunately, these icons not yet standardised and only come with the human theme).
  • Enjoy the new notifications! Note that you must logout and log back in before the new notifications can be active.

For more information on the new notification system in Jaunty you can read up the specification at: http://wiki.ubuntu.com/NotifyOSD.

Advertisements

Setting up a planet

So, how does one set up a planet?

In case anyone thinks I’m nuts, I’m talking of setting up a planet like this (or this). A planet here is just a collection of blogs, and I’ll talk about how to set up one using the software called planet venus. To get started just download the tarball. Extract it into a directory of your choice (using tar zxvf venus.tgz), and you’ll see the directory structure as on the website. The documentation is quite detailed, but if you want a planet quickly, you won’t have to read most of it.

Here’s what I did: I made a directory and copied the file themes/classic_fancy/config.ini to this directory (you might prefer some other theme, in this case choose the appropriate config.ini). Edit the file accordingly; mostly you’d need to change the [planet] section. The other important settings to check are cache_directory and output_dir. It’s better to set the full path here and in the other places which require a directory (template_files) — this helps when running the cronjob later. All the generated files will be in output_dir. You can find the index.html.tmpl (index.html template) in the theme directory and the other templates (Atom, RSS feeds) in the themes/common directory.

Remember to put planet.css and other relevant images in the proper places, otherwise people will see an ugly page!

Now add the feeds which you would like to have in the planet in the following format:

[http://blah.wordpress.com/feed/] # This should be the feed url
name = My Name

You’re done! Now switch to the directory where you untarred the planet venus code and run python planet.py /path/to/config.ini. This will download the feeds, store them in the cache and generate the index.html, Atom and RSS feeds.

Finally set this thing to run as a cronjob (using crontab -e); the snippet below will make planet.py run hourly:

0 * * * * /usr/bin/python /full/path/to/planet.py /full/path/to/config.py

multimedia keys

In Linux, multimedia keys have always been a bit difficult to configure. Sure,
there are third party programs which help, but there’s an easier, more
fundamental way, using xmodmap. What xmodmap does it remap the
keys and give them corresponding X identifiers. For example, this is
how my ~/.xmodmap file looks like:

! This works with Trust Silverline Direct Access keyboard
! Use ! for comments

keycode 222 = XF86PowerOff
keycode 223 = XF86Sleep
keycode 236 = XF86Mail
keycode 229 = XF86Search
keycode 230 = XF86Favorites
keycode 178 = XF86WWW

keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 160 = XF86AudioMute
keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
keycode 176 = XF86AudioRaiseVolume
keycode 174 = XF86AudioLowerVolume

As you can see, the various keycodes have been assigned to the X key
symbols; this enables whichever window manager you use to understand
the keysym. Now you can associate the keysyms with commands, etc. In
Arch a list of keysyms is at /usr/share/X11/XKeysymDB. To apply
these settings simply run xmodmap ~/.xmodmap

multimedia keys control whichever application is active

There are many programs which do not natively support the multimedia
keys, for example the Totem media player. Also you can bind only one
command to be the keybinding for the keysym. So I have made a small
script in bash which detects the active window, and depending on what
window it is, gives the appropriate commands. For example, the script
for the play key is:

#!/bin/bash
# Program to start playing in whichever application
# is the focussed one.

# Abhishek Dasgupta 
# get focussed window id
focus=`xdpyinfo | grep focus | cut -c 16-24`
# grab WM_CLASS
info=`xprop -id $focus | grep WM_CLASS | cut -c 20-`

if [[ "$info" =~ .*Audacious.* ]]
then
  audacious --play
elif [[ "$info" =~ .*Totem.* ]]
then
  totem --play
else
  mpc play
fi

You can grab the full set of scripts:
mediabuttons-scripts-20070508.tar.gz

Currently, as you see the scripts support audacious, totem and mpc.

Arch setup II

So onto part II.

There are a few important things that one needs to remember when configuring Arch – one is that most of the configuration is done through plain old text files; no clumsy or hand-holding GUIs here to help you out. Secondly, most of the configuration files in Arch are in exactly the same place where you would expect them to, i.e. Arch interferes very little with /etc allowing programs to place the files there, without moving them to a special place. Most distributions keep a special system for managing configuration files, Debian has debconf, Gentoo has etc-update, Arch has none, and it needs none. When a configuration file is to be overwritten, Arch will give you a warning; if it does not you can be sure that it’ll not overwrite and instead the new config will be placed with a .pacnew extension.

I am a bit of a console freak, so first off I installed gpm. GPM is this really cool
program which allows you to use the mouse in the console. I did need to a do a bit of tweaking in /etc/conf.d/gpm and I added this line:
GPM_ARGS="-m /dev/input/mice -t imps2"

(other great console apps: irssi, centericq, and of course mutt!)

Another good thing that I like about Arch is its bleeding edge packages. The magic command
to sync up on the newest stuff is pacman -Syu. Also I made sure to install the latest version of pacman (version 3.0.4 as of writing). It seems a bit faster, the progressbar for installing also looks neater; of course there are lot of changes underhood too. The other good news for those wanting to try out Arch for the first time – they’ll release a 2007-05 version (codename Duke) soon with the new kernel 2.6.21. So wait a few days and download that instead of 0.8!

Then I installed slim (the simple login manager) and beryl, compositor-king. In Arch if you know the name of a package, then you can install it with pacman -S package. If you don’t sync frequently you can also tag a -y to it like pacman -Sy package. That’ll make sure you get the repositories refreshed with the changes (-y stands for refresh). You can also search for a package by this package -Ss whatever.

Arch has a few repositories. To put simply, a repository is a collection of binary packages maintained by Arch developers, or other members of the community. The official repositories are current, extra, unstable, testing, community. Out of these current and extra contain stable packages. testing contains the absolutely new stuff, and one that could (but never has, in my case) break your system (like say, a new kernel version or a new video graphics driver). unstable contains, well unstable code. I don’t use it and it doesn’t contain many packages anyway. community is a repo of software that users wrote PKGBUILDs for (I’ll be coming to what PKGBUILDs are, soon) and they have been voted or are important enough, that binary packages are provided for a few of them. (Did you know, that
anyone can upload packages to the Archlinux User Repository?)

If you want to enable some of those repositories, go to /etc/pacman.conf and uncomment out the repos you need, you can also add other repos if you want.

Installing stuff is a no-brainer as I told before. I quickly installed openoffice-base, pidgin, seahorse (manages GPG keys), muttng (grabbed a few configs from codemac, thanks codemac!), screen (the wonderful terminal multiplexer), nitrogen (a wallpaper setter), alunn (excellent notifier for new packages, quietly sits in systray), totem movie player, VLC, etc….

Now onto configuring NetworkManager. First I had to install the required packages (networkamanger and gnome-network-manager if you use GTK+/GNOME or knetworkmanager if you use KDE). Then you have to go to rc.conf and disable the interfaces which we want to use. You must also remember that your wireless card uses a different interface than your ethernet port. That you have to find out by trial-and-error. In my case it was eth2. So in my rc.conf, I now have:

  lo="lo 127.0.0.1"
  eth0="dhcp" #if you don't want dhcp put something like this:
  #eth0="eth0 192.168.1.3 netmask 255.255.255.0" where the first address is the IP you want
  eth2="dhcp"
  INTERFACES=(lo !eth0 !eth2)
  #
  # Routes to start at boot-up (in this order)
  # Declare each route then list in ROUTES
  #   - prefix an entry in ROUTES with a ! to disable it
  #
  gateway="default gw 192.168.1.1"
  ROUTES=(!gateway)

Then you need to install the appropriate drivers for your wireless card (if you haven’t done so already). My card is a Intel IPW3945ABG so I installed the ipw3945 package. For this driver, I also need to startup the ipw9345 daemon, so I added to the DAEMONS array. While using networkmanager, we have to disable the network script, so put a ! before it and also add dhcdbd and networkmanager to the DAEMONS array. Next time you reboot, NetworkManager will take over your network settings from rc.conf. So now my DAEMONS array looks like this:

  DAEMONS=(syslog-ng ipw3945d !network alsa dbus hal @powersaved @mpd dhcdbd netwo
  rkmanager @lastfmsubmitd @lastmp @netfs vsftpd crond slim)

(the @ before some daemons means that daemon will be started in the background)

To use the GNOME applet, you can put nm-applet --sm-disable in your .xinitrc or whatever system your DE uses to autostart apps on login. The reason --sm-disable is required is that otherwise nm-applet gets confused and multiple instances of it startup 😦

Lastly I configured mpd. For anyone who does not know, mpd is a daemon which plays your music in the background. So even if you kill X, your music goes on. There are many good frontends for it; I prefer Sonata which supports editing tags too.

Next time, I will write about how drop dead simple it is to make your own packages in Archlinux. Have a look at the wiki; and till next time happy pacman -Syu’ing!

Arch setup I

It’s been a long time in the coming, true. Due to a lot of stuff in real life, I haven’t been to blog properly. In some ways this is better, as it’s now a month with Arch, and I have a better understanding of it.

So after I booted off the CD (Version 0.8), I got few screenfuls of text, with the livecd checking for binary packages in every removable medium it could find. It seems that arch will allow you to install any package that’s in the /packages directory of some removable media. Then /arch/setup brought me to the installation screen.
That gave me the choices like Partition, Set Mountpoints, Install packages, Install Kernel, Configure System Install Bootloader and Reboot. My hard disk was already partitioned, so there was no problem. I went straightway to set the mountpoints (in my cases just / and /home).

Since I had downloaded the full version of the CD, I had to wade through a lot of packages to finally settle for what I liked. Installing was finished in a jiffy, and then I had to configure the system. I did not touch /etc/modprobe.conf and /etc/modules.conf. /etc/rc.conf is the master configuration file in Arch, having settings for everything from timezone, to what modules are loaded at startup, what daemons are started, etc. The comments are self-explanatory.

Installing the kernel and the bootloader was straightforward. I installed GRUB to the MBR (master boot record) and rebooted.

Then I copied my xorg.conf from my Gentoo install to here. I installed openbox, trayer and a few other applications (like gaim – now pidgin), put them in my .xinitrc
and startx’d.

Since I installed XFCE, which is nowadays heavily dependent on HAL, I remembered to
add hal and dbus to the DAEMONS array in /etc/rc.conf. Also be sure to
add yourself to the storage, optical, video, audio and power groups, otherwise you won’t get a wholesome experience.

I’ll put some more details on how I configured NetworkManager, and how I started
building packages for arch in a later post. What I like about Arch, is its beautiful simplicity. That kind of simplicity really opens your mind up to new possibilities, that’s probably why we have a lot of cool things discussed in the forums; nice and
simple, the kind of tools that make you feel warm and cozy.

Till next time – enjoy the beautiful world of open source!

Arch lands

… on my laptop. Well Arch Linux 0.8 (Voodoo) came out on March 31, and I have been itching to try it out. So one fine morning, I booted with my new Arch install CD (full version) and wiped out my beloved Gentoo. Now after a day of using it, I’m definitely impressed.
Soon, I’ll write a detailed post on how I set up my Arch box, but the main points I liked about this new Arch release, is the installer, which has gotten a lot better, and now includes dynamically loading packages from removable media you have attached while the installation CD is in the drive, and of course Arch’s simplicity.
Long live Arch and keep it simple stupid! 🙂

i915 problems.

Well, this week I tried to install Gentoo on a friend’s Lenovo laptop, replacing his Ubuntu. All went well (Recompiled with glibc 2.5-r1, etc.). Xorg compiled fine too. But while starting, it gives this cryptic error and cops out:
(EE) I810: unknown type(0xffffffff)=0xff

I searched high and low on googlespace for the answer. The only satisfactory solution (sort of) was the one I got from Greg’s page here. He talks of enabling VM86 in the kernel. Unfortunately in the latest kernel, there’s no option that I can find for VM86. Does anyone know why VM86 was dropped in 2.6.19? Next time, I catch hold of his laptop, I’ll install 2.6.18 and see what comes of it.