Tag Archives: progress

nap and nap: Take a nap or two

Two-for-one today, and not just because it’s 02-02, but because I have two programs with the same name, and I don’t think either of them really warrants an entire post to itself.

If you search both Debian and Arch/AUR for “nap,” you’ll find two different programs. The first, from Arch, is a variation on the sleep command, that shows a progress bar as it ticks away.


What you see there is really the grandest example of what I could do with nap, but that isn’t meant to suggest that it has no potential. If you search through this site, you’ll see that in the past two years, I never bothered to make any notes about the sleep command itself, because it was hard to think up something about a program that just waits.

nap does the same thing, but this time tells you how close you are to the end. If you want to know how much longer you’ll have to do nothing, nap will tell you.

The other nap is out of Debian, and is a console client for the now-ancient Napster file sharing protocol.


Unfortunately, that’s as far as I ever got with nap. Its self-configuration routine works fine, and I imagine if you could somehow force-feed it a list of servers, it might get further into its process, but I didn’t have any luck. It sat for the better part of an hour trying to download the server list from GotNap.com, and after that I felt pity and turned it off.

In any case, I don’t know what would be left on the Napster channels. I understand there is still some legitimate content operating under the same name, but whether this program can access it, or if this application is just lost in the dark ages of peer-to-peer networking … I can’t say for sure.

But that’s all for today. I see that my list is getting a bit short. I shall have to go out and beat the bushes this week, and see what falls out. … 😈

dbar and cpubar: Progress for the people

I mentioned pscpug over a month ago, as a neat, vertically scrolling CPU monitor that required very little in the way of system overhead or terminal real estate. You can get something like that from cpubar, which is itself an offshoot of dbar.


Showing you one — and in this case, that’s cpubar, modified slightly for terminal width and the display character — is showing you both of them, since they are tightly related. dbar can stand alone or work as a progress bar with other applications, or be modified or injected into other arenas.

Neither one comes with a makefile or any additional components; click on the download links on the home page, and you get the raw .c file … only. You’re signing on for about 4Kb apiece for the pure code though, and I’m fairly sure you can afford it.

It does also make me curious as to why dbar is bundled in Debian. Seeing how the i386 package expands to about 10 times what the raw downloadable takes, this might be one of those very, very few times when you’re doing just as well to download and build it yourself.

In any case, it’s not in Arch or AUR, which is probably more of an oversight than any statement about inflating tiny programs by bundling them in your distro. If you feel like adopting a terribly simple application and adding it to AUR, this would be an easy one.

Speaking directly to cpubar, you have the option (as I hinted) to stretch the bar to a specific length, given in characters. You can also adjust the interval and select a specific character to show. There are no allowances for color, but I’m sure one of you talented C wizards can come up with a solution to that in about an hour. πŸ˜‰

I don’t have any complaints about cpubar (or dbar, for that matter), except to mention that the character count given as a flag is for the length of the bar only, and not your terminal width. In other words, you have to mentally subtract the 12 characters that are shown statically by cpubar, if you want it to fit neatly into a terminal space. It’s not the way I would have written it, but there’s a lot here that can be adjusted to your liking.

And so, in closing, if you’re wondering what use cpubar (or maybe even dbar) could be, think about a two-line terminal emulator pressed against the root window, showing CPU load at a two-second interval. Or if you’re feeling really ambitious, jam it into conky … or maybe conconky.

That should keep you busy for a while. πŸ˜‰

pv: Why won’t you talk to me?

One of the things that I remember being excited about when I started tinkering with Ubuntu all those years ago, was the sheer volume of new, free toys to play with.

There are, after all, some amazing, amazing tools available in Linux, and not just at the command line. Some of them just make your heart leap with joy as soon as you try them out.

Others … well, they’re useful, but they’re far from electrifying. For example:

kmandla@lv-r1fz6: ~/temp$ ls -lha
total 4.1G
drwxr-xr-x  2 kmandla users 4.0K Mar 19 14:25 .
drwxr-xr-x 27 kmandla users 4.0K Mar 19 15:07 ..
-rw-r--r--  1 kmandla users 4.0G Mar 19 13:15 sample-01.txt

kmandla@lv-r1fz6: ~/temp$ cp sample-01.txt /dev/null

And it sits there. And sits there. And sits there. With no clue as to what’s going on or what is happening, as if suddenly stricken dumb.

Now this on the other hand, is much better:


See that? Why is it so hard for cp or one of the other core Unix-ish tools to just tell me what the heck is going on? I’m looking at you, dd. And mv.

This is not a new complaint. I have mentioned this before, with things like AdvancedCopy. Just a little clue as to what is going on in your head, computer. That’s all I want.

The beauty of pv, which is what’s working in the screenshot, is that it is very flexible. You can use it for progress bars on compression or decompression, network transfers, erasing floppy disks, spilling files into /dev/null … you name it.

You can even dump it into dialog, and give yourself a proper screenful of blue-and-red progress indicators … a la MS-DOS6.22 or something. πŸ˜‰

You’ll have to take a look at the help pages to see how the finer points are worked, but I’m sure you can handle it in its basic form. My best advice is to think of pv like cat, but smarter.

Now if only I could get a petition signed to have pv incorporated into the standard tools. … Ha! πŸ˜†

gcp: Seemingly worthy, possibly flawed

I love being able to see what my computer is doing. What most often frustrates me is when a computer is apparently busy, but gives me no feedback to be sure.

This was the issue a few months ago, when I talked about Advanced Copy. gcp scratches that itch for me too.


And I would speak of gcp in the same glowing terms I used with Advanced Copy, except for one strange issue: I get error messages when I try to use this in an X-less environment. 😯

For posterity’s sake, or for debugging purposes, this is the error message that appears in a virtual console.

Traceback (most recent call last):
  File "/usr/bin/gcp", line 678, in 
    gcp = GCP()
  File "/usr/bin/gcp", line 205, in __init__
    raise e
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

It works fine in a terminal emulator in a graphical environment. But shifting to a console gives that error. I’m not good with debugging, but that’s a little sad.

Perhaps the issue is in the dependencies. Still, I’d sure hate to think that something as simple as a copy tool with a progress bar would rely on all of X to get the job done.

More than likely I have done something wrong. That’s usually the case. Yes, let’s blame it on K.Mandla. 😳

And I see a package called gcp in Debian, and that might be the same. Perhaps it works. Let me know if it does.

I looked for a bug tracker or some sort of feedback mechanism, but I don’t know if it’s available. In the mean time I’ll stick with Advanced Copy, even though gcp was quite promising.