The House of Bits

Just another weblog with some thoughts.

Making Gtk scrollbars more touchscreen friendly

I recently acquired an old tablet PC which I planned to use as an ebook reader. Using my preferred PDF reader, which at the moment is Evince I soon discovered that it’s quite complicated to scroll the document as you have to hit that little scrollbar on the right. Evince does support grab to scroll, but only with middle mouse button, but that is not a valid option with a touchscreen.

One option would have been to recompile Evince and swap the mouse left and middle buttons, but I didn’t feel like going through the hassle. Instead I decided to solve my problem with a simple .gtkrc “hack” by making scroll bar buttons bigger. It took some experimenting, because I was expecting some style properties containing width and height, but they were nowhere to be found.

Here is the content of my ~/.gtkrc-2.0 file on my tablet, it only makes the Evince main window scrollbar bigger, but can be modified to make any scrollbar bigger:

style "big-scrolls" {
    GtkRange::stepper-size = 50
    GtkRange::slider-width = 50
}

widget_class “EvWindow.*.GtkScrolledWindow.*” style “big-scrolls”

When constructing the selector path for the style, one can use Parasite to inspect any existing application. That’s at least what I did with Evince.

Watching movies from within RAR archives

Occasionally it happens, that you have a big multimedia file in a RAR archive and not enough room on your disk drives to unpack it. Not a problem when using command line and pipes!

$ unrar p -inul homeVid.part01.rar video.avi | mplayer -

Time after time the power of command line just can’t cease to amaze me.

Getting `repoze.who` and Pylons working together

Finding an authentication middleware for Pylons was quite a challange, because the most advertised middleware (AuthKit) didn’t really work. At least I didn’t manage to get it to do what I wanted. On Pylons IRC channel someone suggested to take a look at `repoze.who`.
Read the rest of this entry »

Pacman Making It Explicit

After getting hibernation to work, I accidentally rebooted to a previous state that had been left in the swap space. It pretty much trashed my filesystem. So, I wanted to reinstall all packages and somehow managed to reinstall them all as dependencies. To restore explicitly installed ones there should be a possibility to run # pacman -S --asexplicit <PACKAGE>, but for some reason it isn’t implemented in pacman v3.1.3.

So, I whipped up a quick hackish shell script to accomplish the task. Maybe someone with a similar problem will find this useful. But be warned, if something goes wrong, don’t blame me.

#!/bin/bash
# File name: pkg_explicit

if [ -z "$1" ]; then echo "Usage: $0 [--restore] <PACKAGE>"; exit 1; fi

RESTORE=0
PKG_NAME=$1

if [ $1 == "--restore" ]; then
	RESTORE=1
	PKG_NAME=$2
fi

PKG=$(pacman -Q $PKG_NAME 2> /dev/null)

if [ -z "$PKG" ]; then echo "No suck package installed!"; exit 1; fi

PKG_DIR=/var/lib/pacman/local/$(echo $PKG | sed -e "s/ /-/")/

if [ ! -d $PKG_DIR ]; then echo "No such package installed!"; exit 1; fi

if [ $RESTORE -eq 0 ]; then
	if [ -z "$(pacman -Qd $PKG_NAME 2> /dev/null)" ]; then echo "Package already explicit!"; exit 1; fi
	cp $PKG_DIR/desc{,.rec}
	sed -i "/%REASON%/,+2d" $PKG_DIR/desc
else
	if [ ! -e $PKG_DIR/desc.rec ]; then echo "Nothing to restore!"; exit 1; fi
	mv $PKG_DIR/desc{.rec,}
fi

Meebo is actually purple

Meebo is a popular web-based multiprotocol instant messenger (IM) application and my one and only preference for accessing my buddy list when I’m not near my own computer or when I happen to be working in Windows. I had never ever thought of how did Meebo achieve the multiprotocol support it had, but I suppose I thought that they had done it all by them selves.

Today while surfing the Pidgin (formerly Gaim) website, I came across a page that introduced libpurple. To my greatest surprise the list of applications using it contained Meebo as one of them. Given the fact that Meebo has utilised libpurple quite nicely, I couldn’t help but to wonder what other interesting applications could be built upon it.

Read the rest of this entry »

SharpOS looks promising

Over a year has passed since the creation of SharpOS mailing list. I’ve not kept track with the messages there and the state of SharpOS for some time, but yesterday I got the time to have a peek at what has changed, and to my great surprise the project has been making nice progress.

The SharpOS Project is a community effort to write an operating system based on .NET technology, with a strong sense of security and manageability.

Read the rest of this entry »