So it's 2:56 in the AM and I've just hacked up a little app to enable moving up a directory in Windows Explorer by using the Thunar middle click + drag up gesture. You can find it at Win32-Hacks .


Edit: This morning I've extended it to have left and right gestures to go backward and forward respectively just like Thunar and Nautilus. Down is used for exit rather than refresh as Windows seems to take care of this.

Comment on this post.

Automatic agenda notification

This article will show you how to utilize Emacs org-mode, python, a Nokia mobile (others may work too), and an SMS gateway like Clickatell, in order to receive a daily agenda that fits nicely into the phones calendar by using the vCalendar format. Yes that's a fairly specialized combination, but hopefully will be useful to someone. I'm sure it's possible to do the same using bluetooth instead of and SMS gateway, and I may update this to reflect that at some stage..


I can haz assembly!

Simple CPUID, I also experimented with a version using an extra buffer variable and printf. It may not be much to others but I'm learning!


section .data
    buffer:         db  "CPU Vendor ID: XXXXXXXXXXXX", 10, 0
    bufferlen:      equ     $ - buffer

section .text
    global _start

    mov     eax, 0          ; "Get maximum supported standard level and vendor ID string"
    CPUID               ; Call CPUID
    mov     [buffer+15], ebx        ; Move 4 bytes from ebx to buffer+15
    mov     [buffer+19], edx        ; Move 4 bytes from edx to buffer+19
    mov     [buffer+23], ecx        ; Move 4 bytes from ecx to buffer+23

    mov     eax, 4          ; write syscall
    mov     ebx, 1          ; stdout
    mov     ecx, buffer             ; buffer
    mov     edx, bufferlen      ; size of buffer
    int     80h                 ; call kernel

    mov     eax, 1          ; exit syscall
    mov     ebx, 0          ; Return 0
    int     80h                 ; call kernel
Comment on this post.

A simple wallpaper wrapper

Edit as necessary, requires hsetroot, mplayer, and a working xvidix on your graphics card (for video).

# Set Wallpaper

# If $1 is not empty
if [ -n "$1" ] ; then
    case "$1" in
        # Grab last set wallpaper from file and store in $WALL
        WALL=`cat ~/desktop/lastwall`
        # Set $WALL from command line and write to file for future use
        echo $1 > ~/desktop/lastwall

    case "$WALL" in
            # $WALL is an image file, so use hsetroot to set it as the background
            echo Setting with hsetroot...
            hsetroot -full "$WALL"
            # $WALL is likely not an image, so attempt to play with mplayer
            echo Setting with mplayer...
            # Blank out background first
            hsetroot -solid "#000000"
            # "Play" background using colorkey
            sudo mplayer -fs -vo xvidix -rootwin -colorkey 000000 -quiet "$WALL" &

    # Return good
    exit 0
    echo Please specify an image or a video file to set, or use "last"

    # Return bad
    exit 1

To use, run setwallpaper.sh /path/to/image/or/video/file or setwallpaper.sh last

Comment on this post.

Change fonts dynamically

After some Q and A on the ArchLinux forums, I am left with this in my .zshrc, the ability to change fonts on the fly:

vim_font() {
    echo -e '\e]710;xft:Terminus:style=Regular\007'
    vim $*
    echo -e '\e]710;xft:lime:style=Regular\007'
alias vim='vim_font'
Comment on this post.