Stupid Mac OS X Tricks: Terminal + Top

| | Comments (0)

#!/usr/local/bin/perl
use Mac::Glue;
 
my $term = new Mac::Glue 'Terminal';
$term->activate;
$term->do_script(wi th_command => 'top -u');
 
my $win = $term->obj(window => 1);
$win->prop('number_of_rows')->set(to => 50);
$win->prop('position')->set(to => [0, 25]);

I stick this in ~/Library/Scripts and access it from the Script menu. Setting the number of rows makes the window taller, and setting the position puts the window in the top left (else it might end up anywhere on the screen).

Sure, I can just open a terminal window manually and type `top -u`, but that seems so silly when I can just do this! use.perl.org

Leave a comment

<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Entry

This page contains a single entry by pudge published on September 15, 2003 8:57 PM.

Recall Delay was the previous entry in this site.

Learning New Words is the next entry in this site.

Find recent content on the main index or look in the archives to find all content.