From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay3.UU.NET ([192.48.96.8]) by hawkwind.utcs.utoronto.ca with SMTP id <24025>; Tue, 21 Feb 1995 14:08:32 -0500 Received: from uucp1.UU.NET by relay3.UU.NET with SMTP id QQyebs26133; Tue, 21 Feb 1995 14:08:26 -0500 Received: from rexago8.UUCP by uucp1.UU.NET with UUCP/RMAIL ; Tue, 21 Feb 1995 14:08:12 -0500 Received: by summitis.com (smail2.5) id AA04687; 21 Feb 95 13:57:31 EST (Tue) Received: from summitis.com by rserv1.summitis.com; Tue, 21 Feb 1995 13:55 EST Received: from cheetah by rexsrvr2.summitis.com (AIX 3.2/UCB 5.64/4.03) id AA183124; Tue, 21 Feb 1995 13:52:56 -0500 Received: by cheetah (AIX 3.2/UCB 5.64/4.03) id AA17856; Tue, 21 Feb 1995 13:52:54 -0500 From: hc05@summitis.com Message-Id: <9502211852.AA17856@cheetah> Subject: 9menu and sam To: sam-fans@hawkwind.utcs.toronto.edu (Sam mailing list) X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Date: Tue, 21 Feb 1995 14:08:25 -0500 I read the excellent article on the UNIX Plan 9 tools this weekend and realized that I can extend sam. I understand why basic sam doesn't have macro capability, but there are some things that I do a lot that would be nice to do with the mouse. I use samx2, and wouldn't use sam without it, but while it has macro capability, I'm not big on learning lots of arbitrary key sequences, even my own. For these reasons I've put together a 9menu containing some basic sam commands that I need. When I want one, I go out to the 9wm menu, bring up 9menu, and make my choice. It has made things much easier. I include the script here in case anyone is interested. Some of the specific macros may be useful to others, and some will only be meaningful to me, but I figured I would include some examples. I wrote this in perl because I haven't gotten far enough into the 9 tools to use rc. Beirne ---------------------------------------------------------------------- #!/usr/local/perl ($name) = getpwuid($>); $pipe = '/tmp/.sam.'.$name.'.'.$ENV{'DISPLAY'}; $pipe =~ s/:0$/:0\.0/; $pipe =~ s/\.0$// if (! -r $pipe); exit if ($pipe =~ /^\s*$/); $ENV{'SAMPIPE'} = $pipe; exec "9menu", "-label", "sam menu", "-popdown", "-iconic", "-geometry", "+0+0", 'dashed line:echo "i/----------------------------------------------------------------------\\\\\n" >'.$ENV{'SAMPIPE'}, 'eroff memo template:echo "r $T/ermemo\n,x/Your_name/c/B. Konarski" >'.$ENV{'SAMPIPE'}, 'eroff preview:echo ",>preview" >'.$ENV{'SAMPIPE'}, 'eroff print:echo ",>tbl -D | eroff -mm -mr" >'.$ENV{'SAMPIPE'}, 'format:echo "|fmt" >'.$ENV{'SAMPIPE'}, 'shift left:echo "x/^ /d" >'.$ENV{'SAMPIPE'}, 'shift right:echo "x/^/a/ /" >'.$ENV{'SAMPIPE'}, 'spell:echo ",|cspell" >'.$ENV{'SAMPIPE'}, "exit" ---------------------------------------------------------------------- -- ------------------------------------------------------------------------------- Beirne Konarski | Reading maketh a full man, conference a beirnek@summitis.com | ready man, and writing an exact man. "Untouched by Scandal" | -- Francis Bacon -------------------------------------------------------------------------------