Banishing the cursor in dwm

16Oct08

When I was using Ratpoison, I made regular use of the C-T b function that sends the cursor to the bottom right of the screen, out of view. When I was looking for another window manager to satisfy my masochistic/minimalistic needs, I missed having that feature.

After using dwm for a while, I forgot entirely about it. I snooped around in AUR for a separate application that could move cursors about and found xwarppointer.

Last night I quickly created a new script called hidecursor.sh in my personal bin folder:

#!/bin/sh
xwarppointer abspos 1023 767

And made a new keybinding under static Key keys[] and a command above it in config.h:

static const char *hidecursor[] = { "/home/colin/bin/hidecursor.sh", NULL };
{ MODKEY, XK_a, spawn, {.v = hidecursor } },

So every time I press Caps Lock + a (Caps Lock is my modkey) the cursor magically relocates itself out of my view. I probably won’t be using it too often, unfortunately, as I think I’ve gotten used to having a cursor obscuring the text at times.

There must be a way of calling xwarppointer abspos 1023 767 directly from dwm without going through a script, but I have no idea how to do so. Admittedly, it works fine, so it will have to do for now.

Advertisements


3 Responses to “Banishing the cursor in dwm”

  1. 1 macondo

    I’m using icewm-lite in debian, i installed ‘unclutter’ and put it in my .xinitrc:

    unclutter &

    it makes the pointer disappear after 5 seconds, it will come back if you move the mouse.

  2. There’s also swarp, available from the community repo and it’s made by the very same developers of dwm. To run directly from dwm:

    static const char *warpmouse[] = { “swarp”, “1680”, “1050”, NULL };

    { MODKEY, XK_a, spawn, {.v = warpmouse } },

  3. 3 mentallaxative

    Thanks Thayer. That is a much shorter way of moving the pointer rather than passing the command through a bash script.



%d bloggers like this: