Convenient ssh in Gnome, or 'my sshmenu wish comes true'
It turns out that I can get something that more or less does what I wanted sshmenu to do (per yesterday's entry). In email Dan Astoorian pointed me at the Gnome 'Command Line' applet and that it has macro capabilities; you can define a pattern and a command to run (using bits of the pattern) when the pattern matches the 'command' that you type. Thus, you can hijack it into a 'ssh session launcher' with suitable patterns.
The current patterns and commands that I've set up are:
^([a-z0-9.@]*)$ |
gnome-terminal -e "ssh \1" |
^(-.*)$ |
gnome-terminal -e "ssh \1" |
^s (.*)$ |
gnome-terminal -e "ssh \1" |
^r (.*)$ |
gnome-terminal --terminal-with-profile=RedText -e "ssh root@\1" |
(The RedText profile just has a foreground colour of #FF4500 (the classic X 'OrangeRed' colour value) instead of black, so that my root sessions stand out.)
This is actually better than just having a sshmenu text widget that I can type hostnames into, because I get significantly more flexibility. It helps that I already do something similar to this in my regular environment and actually like this peculiar form of mini-commands.
(If I was trying to make Gnome my normal environment I'd put all of the intelligence in a script and just feed all of these patterns to it, because it's much easier to make a script be super-smart than some regular expression matches, but that's too much setup work for what is really supposed to be quick customizations.)
I may well be doing this wrong (although it seems to work) or in a way that could be done better. In the usual Gnome style, the Command Line applet's macro stuff is underdocumented, with specific details about things like macro matching order and the like being notably lacking.
|
|