Search this site


Metadata

Articles

Projects

Presentations

Random statistics.

  • Lines of code in my svn repository, by file extension: c 27676, cpp 11488, h 2780, html 1566, java 5496, js 2994, pl 2278, pm 3215, py 2062, sh 1459, xml 8602.

    These were generated via 'wc -l' and hence don't ignore comments. There's a few thousand lines of code in there that I didn't author, but I didn't expect those numbers to be so high. Crazy.

  • Number of posts to this website: 314 posts, 11 articles, 22 projects.
  • Histogram of length for unique commands my shell history:

xdo "beta" release

I've been working furiously on xdo the past few days. Good times :)

The result so far is as follows:

  • xdo is now a library, so you can simply call xdo_click(...) and it will handle all the hard stuff for you for the case that you want to use this in your own code.
  • xdotool is the commandline interface to the xdo api.
  • navmacro (bad name) is a very small gtk launcher. Basically it's an input box that runs the contents when you hit enter
I include a sample script 'ffsp' which is short for 'firefox searchbar paste'. It works on my system, but obviously on other systems you'll need to tweak it. The basics are there.

So right now, I can do this:

  1. Select a piece of text in an xterm
  2. Activate navmacro and type 'ffsp' and hit enter
  3. Enjoy the fact that firefox has been told to search for the contents of my clipboard
'ffsp' is located in my $HOME/bin/ so I execute it like any other shell script or program.

Interested in the code? Download navmacro-20070620.tar.gz.

Note: navmacro works on my ubuntu and freebsd systems just fine. However, xdotool crashes at the end when I do free(xdo->charcodes) only on my Ubuntu system. Uncertain why, I'm way too tired to debug.

USB Mouse support in newmoused, working.

I've got my usb mouse working with the new moused. Most of the code in the module is ripped from usbhidctl(1). Now that I *actually* know how things work, I found that the read() wasn't actually one with side effects. Good.

You'll need the new moused framework for this module.

Basic instructions:

  1. Download my moused framework (newpsm project on this site)
  2. Recompile your kernel without "device ums"
  3. Build moused, build the usbmouse module.
  4. Run moused: ./moused -m usbmouse -d /dev/uhid0
If it doesn't work, let me know.

moused-usbmouse.tar.gz

Future plans:

  • Rewrite ugly bits
  • Port ums(4) hacks for broken mice
  • Test with more mice
  • Write uhid joypad support

USB Mouse support in-progress for newmoused/newpsm

I started working on usb (usbhid) mouse support for my newpsm/newmoused project. So far so good, I can probe /dev/uhidX devices and figure out if it's a mouse or not. Thankfully, usb hid is very easy. Unfortunately, FreeBSD (NetBSD's) implementation is somewhat crazy with the voodoo.

To see what I mean, look at: src/usr.sbin/usbhidct/usbhid.c.

Look near line 230 (the only read() call in the file). Notice the read() call, but 'dbuf' is NEVER used meaningfully. More specifically, the read is mostly ignored and a loop is done over the 'hids' list. Looks like read()s on usbhid devices pushes data to special places in memory which can be found by using hid_start_parse(). A read() shouldn't be doing this. This is the job for an ioctl() or something. read(), to me, says "give me data so I can use it" - not "update some magic places in memory, thanks"

Eek.