You are not logged in.

#1 2009-03-29 13:46:53

yasen
Member
From: Bulgaria
Registered: 2009-03-05
Posts: 39

fittstool - bind screen corner mouse button events to commands

I wrote a small utility that allows you to bind commands to mouse button events at the screen corners in X, it's called fittstool, after Fitt's law (check http://en.wikipedia.org/wiki/Fitts'_law).

It's located at: http://code.google.com/p/fittstool/

I've tested in only in Openbox but it seems to work fine with my setup (1 monitor, Openbox, tint2 panel). It uses less than a MB of memory.
One example use is to use it as a replacement for Volwheel (it's too big, a Perl interpreter takes around 10MB of RAM), binding mouse wheel scroll up and down events to the "amixer" command. I use it for some application launching tasks and for Rhythmbox control presently.

Here's my ~/.config/fittstool/fittstoolrc for you to gain some insight on what it can be used for:

#volume control in the top right corner:
TopRight.WheelUp     = amixer -q sset Master 2+
TopRight.WheelDown   = amixer -q sset Master 2-
TopRight.RightButton = amixer -q sset Master toggle
TopRight.LeftButton  = xterm -C alsamixer

#launch applications
BottomRight.LeftButton = xterm -C htop
BottomLeft.LeftButton  = opera -nomail -nolirc -notrayicon
TopLeft.LeftButton     = thunar ~
TopLeft.RightButton    = thunar /media/data/download

#Rhythmbox control
#this will start rhythmbox if not started
BottomCenter.LeftButton  = rhythmbox-client --play-pause
BottomCenter.RightButton = rhythmbox-client --next

Once you get used to such shortcuts you gain another level of usability to your computer experience matching that of keyboard shortcuts - you can use these actions at the screen corners with the same quickness with your right hand, just as doing "ctrl-c", "ctrl-s" with your left one! smile

Here's a sparse wiki page about usage: http://code.google.com/p/fittstool/wiki/FittstoolUsage

You're welcome to hack on the code and make it better if there's something that it lacks.

Here's a PKGBUILD for it, so you can install it via pacman:

# Contributor: Yasen Atanasov <yasen.atanasov@gmail.com>
pkgname=fittstool
pkgver=0.1
pkgrel=1
pkgdesc="A tool for binding mouse button events on the screen corners in X to commands."
arch=(i686)
url="http://code.google.com/p/fittstool/"
sourceurl="http://fittstool.googlecode.com/files/"
license=('GPLv2')
depends=(libxcb glib2)

source=($sourceurl$pkgname-$pkgver.tar.gz)
md5sums=('985570a1ec0dfd1ada0166e909237130')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  ./configure --prefix=/usr
  make || return 1
  make DESTDIR="$pkgdir/" install
}

Offline

Board footer

Powered by FluxBB