Tag Archives: programming

blessed-contrib: A well-earned clamor

I’ve gotten three or four links to blessed-contrib in the past two weeks; thanks for the tips. Usually a quick flurry of attention like that means two things — first, that it appeared on a forum or in a news post somewhere, and second, that it probably is very good.

It seems the clamor is well-earned this time. Here’s the “example” arrangement.

2015-01-27-6m47421-blessed-contrib

The animation is missing there, which is a shame, because just about all of those little widgets have some sort of activity going. If you want to see the full effect, try the animated image on the Github page.

I haven’t said what blessed-contrib is, because it’s what you make it. This is a tool toward other things, and not so much an application on its own. So if you were expecting those little doo-dads to dial you into NORAD a la WarGames, it’s not going to happen … unless you can make it happen. 😯

It’s fun to tinker with blessed-contrib, but you will need a degree of programming ability and access to a few other ancillary projects — some of which, like spark, we’ve seen here.

I also feel obligated to mention that the effect was somewhat lost in a virtual console (on my Arch machine, anyway) because, as is wont to happen, some of the text shapes used in the graphs were inaccessible to the screen font. I’m sure there are ways to specify the exact characters used in those graphs, so you might want to keep that in mind if you decide to pull blessed-contrib into your next killer app for the console.

From what I gather, blessed-contrib is fairly new, and I see edits as recently as a few days ago. Ergo, this is not in Debian or Arch/AUR. If you want to give it a spin, I installed python-blessed out of AUR and nodejs from community, then followed the quick install instructions on the home page to get as far as the demonstration panel.

If you come up with something entertaining, by all means share. πŸ˜‰

wpe and we: Someone’s been reading my mind

If you’ve ever wondered, the answer is yes, I do have a short checklist of things I like from a text-based program. And I don’t mind sharing it. A program should …

  • function, which is to say, does what it promises;
  • have color, which you knew was coming;
  • use a full-screen interface, as opposed to just single-shot commands;
  • accept flexible terminal dimensions, because tiling window managers are a reality; and
  • show on-screen (or at least on-board) help, as a courtesy to get people started.

I could mention a few more but they would be minor — like relying on $EDITOR and $PAGER, not doing too much at once, allowing (at least a little) customization, using conventional tools whenever possible, and so forth.

There are some shortcuts, like using an F1 key to display the man page for the program, and I appreciate that because it ties two points together. And sometimes I’ll forgive one point if a program touches another in an amusing way. But for the most part … that’ll do, pig.

So we come to wpe, a programming environment, which includes its sister editor tool, we:

2015-01-19-6m47421-xwe

And you can probably see that this is a slam-dunk. wpe not only tackles all of the major points, but manages to throw in a few I hadn’t really thought to mention.

wpe (and we, to a lesser degree) adds:

  • A built-in file manager.
  • A built-in windowing system, with tiling and cascading modes.
  • Built-in programming references.
  • Old-school Wordstar-ish block selection for copy-and-paste functions.
  • Window zooming, which is sort of like maximizing a document.
  • gpm-driven mouse support.
  • Syntax highlighting and compiler access (I think. Check that; it’s my weak point).
  • Drop-down menus and popup dialogues.
  • X-based versions for those who can’t let go. πŸ˜‰
  • Gobs upon gobs of other features.

It’s like someone’s been reading my mind. 😐

I know I talk big, but I still wander around the planet editing my config files with vim, just because it’s there and because I’m too much of a clod to actually make a switch.

But this is seriously pulling at my heart strings. we in particular is an easy replacement for anything I do editing-wise at the terminal, and as a bonus a lot of its features and configuration appear to mimic the almighty Midnight Commander, which I’ve mentioned here ad nauseum.

It’s a new year. It’s a good time to experiment. I think I’ll hot-wire vim to point to wpe for the day, and see if I notice a difference. If I’m not driven mad by 4 p.m., we’ll call it a success. πŸ˜‰

Regardless of my sanity at 4:01 p.m., let’s stamp this with the gold star of K.Mandla approval: ⭐ For what little that’s worth, of course. … πŸ™„

P.S.: In both Debian and AUR as xwpe, which is the name of the X-based version, but encompasses all four versions. Strange, Debian didn’t split this one out into -console versions. Hmm. … 😐

cscope: The code navigator

Short post this time, since I have almost no frame of reference for cscope. I have all the coding ability of a day-old banana peel, so a tool that searches, arranges and navigates source code files is far and beyond me.

2014-12-17-6m47421-cscope

That’s cscope picking through the source code for curl, which was just an arbitrary choice. Nothing to be inferred in that.

It’s a very smooth tool though, and if you spend any time at all navigating large files or skimming through trees of code, I can see where cscope would be a huge asset.

From my very cursory inspection, you can set search strings or patterns through the prompts at the bottom of the screen. Matching lines will appear in the top half, and you can use the arrow keys to pick through them. Press enter, and cscope opens your $EDITOR for you to make changes.

Help is available at the ? key, and you can exit with CTRL+D. Just so you know. …

I know very little about coding, even less about cscope, and have only a brushing knowledge of some of the search tools aimed at developers — programs like ag or ack. I can see where cscope might be preferable though, since it offers an interface to your activity.

But of course, you are the best judge of that. πŸ˜‰

codemetre: Counting out the lines

If you’re a programmer, this one might appeal to you. This is codemetre.

2013-09-25-v5-122p-codemetre-01 2013-09-25-v5-122p-codemetre-02

Left is default, right has been piped through column --table. As you can probably figure out, codemetre is counting the number of lines of code and comparing it to the number of comment lines.

It’s a very simple tool, but probably more appealing to people who program regularly. For my own part it’s more a curiosity than anything.

codemetre has a few extra settings that you can adjust as flags, and depending on the coding language you use, it might behoove you to check. Ordinarily codemetre seems to be able to detect them automatically.

I have to stop there, mostly because I don’t program and so this is really only a footnote for me. Of course, if someone mentions the need for a code line counter, I’ll know what to tell them. πŸ˜‰

awk: Not so much an application, as a language

As if yesterday’s post about two video editor suites with console-only interfaces wasn’t strange enough, here’s a post about awk.

2013-08-15-v5-122p-awk

awk isn’t an application. In fact, I had serious reservations about mentioning it at all, because it’s so very distant (in my opinion) from an application.

Saying awk is an application is like saying a paintbrush is art. It’s not the result, it’s the tool you use to get there.

There’s the added complication in that, at least on my Arch system, awk is actually provided by the gawk package. With nawk, mawk and some other *awks available, as I desire.

So it’s not just one flavor, in a package called “awk.” There are many. And they seem to reproduce, like rabbits. Or clothes hangers. 😯

I won’t pretend to be any kind of programming expert, even if I’ve done a little tinkering with (m)awk in the past. I know my limitations, and actually programming something is where I find mine.

On the other hand, there are countless tutorials, howtos, case examples and gimmicks out there using awk. Just search the internets for awk, and the first dozen will give you mounds more information than I can.

But here’s one push, toward my own personal favorite. Have fun. πŸ˜‰