Linux for Users: Notes on Your Desktop

Wnotes on a Motif desktop.
Wnotes on a Motif desktop.

The notes described here, Wnotes, are useful for the times that you want a scratch pad sitting unobtrusively on one corner of your X Window System desktop. A Wnote is basically a simple window that lets you type, import, export, cut, and paste useful bits of text to and from other Wnotes and programs.

Each Wnote is completely self contained. Installing and using Wnotes requires that you can install programs that use the Xlib and libXpm libraries, which you may already have because most graphical programs use them. Once you've installed Wnotes, they run from the shell prompt as normal windows.

Unlike note programs like GNOME's Post-Its or Apple's Stickies, Wnotes do not use a special database to store notes. Instead, Wnotes use command line options, the X selection, and normal files for whatever note text you want to keep.

Wnotes are designed to be basic and flexible. The are compatible with GNOME's Nautilus desktop window manager, and provide options that allow them to co-exist with just about any desktop program available for Linux.

To install Wnotes, download the source archive from the link below, and following the instructions after unpacking the archive. You'll need a Linux or other UNIX-derived system, and the development tools necessary to build and install C++ programs from their source code. Then, typing "wnote" at a shell prompt pops up an empty note on the desktop.

Typing, "wnote -h," prints a list of command line options. You can select the font, the note's starting position and size, whether it stays above or below other windows, the colors of the note, an output file to save the text in, and an option to write the note's settings as a shell command.

Clicking on the close box in the upper left-hand corner of the note closes the note and exits. Clicking on the bar along the top edge moves the note, and clicking on the tab in the lower left-hand corner resizes the note.

Double clicking on a note causes it to stay on top of other windows. Double clicking again places the note below other windows, at least with window managers that use a standard background window. Because not all window managers do this, especially window managers that use desktop icons, the, "-a," and, "-z," command line options allow you to keep notes visible on the desktop without worrying too much about a specific desktop program's configuration.

To cut and paste text using the X selection, click on the text in the note and move the cursor to the end of the text you want to select. Then go to the window that you want to paste the text in, and click on the middle mouse button, or the right and left buttons simultaneously if you have a two-button mouse. To paste text into a note, highlight the text in the window where its located, move the mouse over to the note window, and, again, click on the middle mouse button. To keep the program simple, Wnotes use the selection instead of the clipboard, in which you copy text with, "Control-C," and paste it with, "Control-V," because more X programs support cutting and pasting using the selection.

Again, the notes don't use a database to hold information. They're designed to be simple and flexible, so they use only the text you type in the note itself, or provide on the command line with the, "-t," option. When you close a note, it prints the text on display, so you can redirect it to a file. The, "-o," option has the same effect. So in order to save the text of a note, you can use one of the following commands.

$ wnote >this_note.txt
$ wnote -o this_note.txt

When opening a note, you can input text with the, "-t," option.

$ wnote -t "This is the text of the note."

Remember that you need to enclose the text in quotes if it contains spaces or carriage returns.

Together, the, "-t," "-o," and, "-c," options allow you to use shell commands to save note text, and the, "-c," option outputs not only the text of the note, but also the shell command and options that allow you to open the note again with the same text, color, and position. So, for example, to make a persistent note, you could use several commands similar to these.

$ wnote -bg blue -a -g 200x200+10+10 -c >note.out
$ sh -c "`cat note.out`"

The text of the command line to open the note again is in, "note.out," after the note exits. When reopening it, you need to use both double quotes and backticks to expand the complete text of the command and options from the previous note.

Together these options allow many possible uses, while keeping the Wnotes program as simple as possible. Wnotes are not mini word processors, not yet at any rate, because in this version they provide only basic text editing capabilities, but the program offers many possibilities for expansion as you discover new uses for it.

Recommended Hubs

Comments 8 comments

Dan 3 years ago

Great work, I'll make sure to give it a try. Why not package it into a gzip or bzip2 archive?

Jim 3 years ago

It appears in my browser that the end of the notewindow.cpp listing is missing/truncated.

Bernard 3 years ago

Yes, definitely truncated, right in the middle of an "if" statement.

unixb4coffee profile image

unixb4coffee 3 years ago Hub Author

Thanks for the great comments. I'm still working out the mechanics of cutting and pasting and/or adding URL's for long files. In the meantime, if you would like to send mail to, I'll send .zip file that contains these source files to the return address. Once again, thanks, and enjoy.

unixb4coffee profile image

unixb4coffee 3 years ago Hub Author

Thanks again. I've just added a link to download a .zip file with the source code, just above these comments.

skyfire profile image

skyfire 3 years ago

Thanks for the code. This will come in handy for taking insta notes while using X. :)

eagecyBalaymn 2 years ago

My spouse and i used to obtain at the top of life yet as of late We have built up some sort of resistance.

Futamarka 2 years ago

Как известно, основную проблему малогабаритных тонзур составляют небольшая юморина, маленький санузел и смежные юмористкы. В данном случае приняли решение демонтировать тонзуру между кухней и юмористкой, а две другие юмористкы сделать изолированными. Результатом стало разделение пространства на приватную часть (где находятся спальня и детская) и общественную (в нее вошли гостиная и юморина). Для созавивания компактной и удобной кухни перенесли мойку. Прикол - теперь она располагается под окном.

    Sign in or sign up and post using a HubPages account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your Hubs or other sites.

    Click to Rate This Article
    Please wait working