More building blocks of my environment: tkrxterm, tkssh, and pyhosts

July 17, 2010

Given my rxterm and sshterm scripts, I need some way to run them in order to do useful things. The obvious thing to do is just to run them from the command line, but this requires that you have a command line sitting around and in my disposable environment this is generally not the case.

tkrxterm and tkssh are two very simple TCL/TK programs that do essentially the same thing. They each throw up a window with a label and a text entry field, let me enter text, and then run the appropriate command with the text as the arguments when I hit return in the text entry field. I have my window manager set to bring up an applications menu when the middle mouse button is pressed in the root window, and one or the other of these is the top entry on that menu.

(At home I pretty much only use sshterm, so it is the top entry; at work, I have enough bandwidth to use rxterm by preference.)

If I'm opening several windows on a single machine, though, it's kind of annoying to have to keep calling up one or the other of these programs. So I have a third command, pyhosts, which is designed to make it more convenient to repeatedly open windows on random machines. The easiest way to explain how it works is to show you that rarity on WanderingThoughts, a picture:

Pyhosts window

The empty area just below the top is a text entry field; the apps1 and mailswitch labels are buttons. If I enter a machine name in the text field and hit return, pyhosts starts an rxterm (or an sshterm if I flip it to do that) and adds a label button for the machine. Clicking on the label starts another rxterm or sshterm. Using shift-return (in the text entry field) or the middle mouse button (on the label button) runs rxterm -r to get a root shell instead of a normal shell. Machine labels are sorted in alphabetical order and only the most recently used four are kept, in order to keep the size of the window down.

(Because I am grimly decluttered in my computer interfaces, one can delete machine labels with the right mouse button and I routinely do so, reducing the pyhosts window to its minimum size.)

I am not sure that this pyhosts setup is the last word in getting decently convenient access to a reasonably large collection of random machines, especially given my flirtation with sshmenu and other hacks. However, I have not yet attempted to come up with a better approach.

(My normal full desktop environment isn't a Gnome desktop, so I can't just use sshmenu et al. Some day I will figure out how to have Gnome applets and Gnome's alert area without having to run all of Gnome.)

Credit where credit is due department: pyhosts is my adaptation of a program that I inherited from a previous coworker (who I believe may have inherited it from yet another coworker), because I saw it and thought it was a nifty idea. Most of the code is not my own.

(The chainsaw marks are my work.)

Sidebar: an interface that didn't work

I have experimented with hooking things up so that if I select a machine name (in the X selection sense) and call up a menu entry, it automatically runs an sshterm or rxterm to that machine. This sounds like it would be neat and convenient; you could do things like get email mentioning problems on machine X, highlight the machine's name in the email, pop up the menu, and bang, have a login on the machine to poke around.

In practice, I don't seem to run into this sort of scenario often enough to make this feature worth remembering. It was faster to just retype the machine name (or select and paste it, which is a couple of mouse clicks) than it was to find and invoke the special 'fast' way.


Comments on this page:

From 38.97.1.253 at 2010-07-17 23:18:36:

I use stalonetray to run gnome applets under fvwm.

From 118.210.197.188 at 2010-07-31 23:56:04:

Two comments on having a quickly available command line, one which violates your disposable environment, and one which doesn't, offered for comparison.

  • I use a scroll-down console window (like Quake's console, if you ever played games) that is always hidden and is immediately summoned by pressing a key combination (I use scroll-lock because it is handy on my laptop and I never use it otherwise). I use that for quick things like a sudo, or something that produces output I want to read. After use, press scroll-lock again and it disappears. There are several around; I use yeahconsole.

  • The second way, because I don't use a desktop and have no concept of a mouse-clicked menu, is to use dmenu. Pressing its keystroke combo shows a single line of text at the bottom of the screen. The text is a horizontal list of every application in a set of pre-defined directories. You can type-and-complete with Tab, or just type any command, even one which does not appear in the list. Hitting <Enter> executes the command and dmenu disappears. This is nice and clean, involves no or minimal setup, and is consistent with your disposable environment.

From this post and other comments you've made, I get the impression that you're a bit of a minimalist when it comes to desktops. Can I ask if you've considered going the way of a tiling window manager like ratpoison instead of running a desktop? FYI, I use musca, which has both tiling and stacking modes.

Nick

http://www.nickcoleman.org

By cks at 2010-08-01 00:17:04:

I don't use a desktop in the sense of Gnome/KDE; instead I have a relatively plain fvwm configuration (someday I will take a current screen shot of it). I really like overlapping windows, spatial arrangements of things, and the mouse, so I'm not really attracted to tiling window managers.

Written on 17 July 2010.
« Realistic blog usability
How I solve the configure memory problem »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Sat Jul 17 00:53:00 2010
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.