Categories
Geek / Technical

Graphical Tip for X

While I think KDE and Gnome are great, I’ve grown accustomed to Fluxbox. It’s a lightweight window manager and does all I need it to do. One day I plan to use FVWM because it is so configurable, but Fluxbox is great for now.

I also use Debian. Debian has added a common menu for each desktop environment and window manager. While it is normally very nice, it doesn’t please everyone all the time, and there is one thing I can specifically complain about:

Now, xsetroot is a command line tool. It is, according to the man page, a “root window parameter setting utility for X”. Normally people use it to set the background to an image. KDE and Gnome and other window managers have simple, GUI-based ways to let you do so, but for people who prefer config files and scripts, xsetroot is the command you use. Of course, it needs arguments to be useful.

So what happens when you run xsetroot without any parameters? It resets your background and your mouse cursor to the default X settings. Essentially, it means your mouse is now a cross instead of an arrow and your background is made up of an annoying-to-the-eye pattern. So when you click on that menu entry, you end up with an ugly background and mouse cursor. Why would they put that entry in there?!

Luckily, Fluxbox lets you change the style from the main menu, so the background could revert back to what I had before, but the mouse cursor stayed the same. I didn’t want to have to restart the X server just to get a good mouse cursor back, so I decided it was finally time for me to learn how to change it manually.

After some IRC inqueries, man page requests, and some Googling, I found Customizing X Windows Tips. At one point, it mentions the various standard mouse cursors you can use. The command to use is xsetroot -cursor_name <cursorname> where cursorname can be one of entries in /usr/X11R6/include/X11/cursorfont.h
Some examples:

  • draped_box
  • hand1
  • hand2
  • iron_cross
  • left_ptr
  • plus
  • top_left_arrow
  • watch

Well, now that I know about it, it is pretty easy, but it isn’t very obvious to someone who doesn’t know. KDE and Gnome users are probably laughing at me as their mouse cursors are handled by the desktop environment, and Windows and Mac users might be thinking that using Gnu/Linux is tougher than it really is, but hey, I now know something that I didn’t know before. My computer is that much less mysterious. Some people might prefer to just get things done without knowing how the computer works, but I am a curious person. Before, I was always afraid of accidentally running xsetroot from the menu and not being able to recover. Now, I can feel comfort knowing that if something does go wrong, I can fix it, and I also know a lot more about the issue to make things better for me if I want. I am planning on writing a GUI to pick a mouse cursor for people who might not want to know about how things work and so don’t care to figure out how to fix it. I imagine that one might already exist for X11, but I haven’t seen it yet.