From owner-freebsd-questions@FreeBSD.ORG Wed Dec 8 00:31:16 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D15DB16A4CE for ; Wed, 8 Dec 2004 00:31:16 +0000 (GMT) Received: from pd4mo2so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 848CE43D68 for ; Wed, 8 Dec 2004 00:31:16 +0000 (GMT) (envelope-from flowers@nekulturny.org) Received: from pd4mr6so.prod.shaw.ca (pd4mr6so-qfe3.prod.shaw.ca [10.0.141.69])2004))freebsd-questions@freebsd.org; Tue, 07 Dec 2004 17:30:19 -0700 (MST) Received: from pn2ml10so.prod.shaw.ca ([10.0.121.80]) by pd4mr6so.prod.shaw.ca (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0I8D009I2O2J70I0@pd4mr6so.prod.shaw.ca> for freebsd-questions@freebsd.org; Tue, 07 Dec 2004 17:30:19 -0700 (MST) Received: from procyon.nekulturny.org (S0106000c41b2b9a3.cg.shawcable.net [68.144.45.143]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003)) with ESMTP id <0I8D009NOO2J1E@l-daemon> for freebsd-questions@freebsd.org; Tue, 07 Dec 2004 17:30:19 -0700 (MST) Received: from procyon.nekulturny.org (localhost.nekulturny.org [127.0.0.1]) iB80UI3W001889; Tue, 07 Dec 2004 17:30:18 -0700 (MST envelope-from flowers@nekulturny.org) Received: (from flowers@localhost) by procyon.nekulturny.org (8.12.10/8.12.10/Submit) id iB80UIIS001888; Tue, 07 Dec 2004 17:30:18 -0700 (MST envelope-from flowers) Date: Tue, 07 Dec 2004 17:30:18 -0700 From: Danny MacMillan In-reply-to: <20041124092452.34756.qmail@web51603.mail.yahoo.com> To: Mark Jayson Alvarez Message-id: <20041208003018.GA834@procyon.nekulturny.org> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline References: <20041124092452.34756.qmail@web51603.mail.yahoo.com> User-Agent: Mutt/1.4.2.1i cc: freebsd-questions@freebsd.org Subject: Re: This is a cool shell prompt question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2004 00:31:17 -0000 On Wed, Nov 24, 2004 at 02:24:51AM -0700, Mark Jayson Alvarez wrote: > Good day! > I'm just wondrin if its possible for me to run > applications at boot time but on another terminal. I > find it cool to have a huge digital clock (grdc) > running on background so that I can just shift to > another terminal whenever I want to know the time. > Actually, all I really want is a clock that is > continuously ticking whatever I may be doing(in > terminal window). I've already learned how to set my > prompt to multiple lines and also displaying my > current working directory. But now, I want it even > more informative displaying a ticking digital clock in > my shell prompt like the one i'm seeing in my kde > system tray right now. > Is it possible?. Thanks. This is a job for GNU Screen! Actually, this is the least of screen's abilities, but it does give you exactly what you want (plus more!) and it doesn't depend on what shell or other program you are running in the terminal. 1. Install GNU Screen ( /usr/ports/misc/screen ) 2. Create ~/.screenrc containing the following: # Delta applied to /usr/local/etc/screenrc startup_message off escape ^\\\ defscrollback 2048 hardstatus on hardstatus alwayslastline hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %Y/%m/%d %0c:%s " nethack on msgwait 1 msgminwait 1 Most of this is optional; these are the settings I use. The most important thing for the ticking clock are the hardstatus lines; the longest has almost certainly wrapped. 3. Now when you log in, your first command should be something like: screen -S main -xRR ( man screen for alternative approaches ) Now use your computer as you ordinarily would. You'll have to 'exit' twice to log out; the first exits screen and the second exits the spawning shell. Or, you can: 4. Run screen automagically in every interactive shell. How exactly to do this depends on your shell and other configuration; I do it by putting the following at the very end of my .zshrc ( I use the Z Shell, and have no .zlogin or .zlogout ): if [ ! $TERM = "screen" ]; then exec screen -S main -xRR fi Now screen is login-shelly; it runs automagically in every terminal session and you will automagically be logged out when screen exits. There are implications to having it run this way (take note of the 'exec' above). Anyway, there are heaps of information available regarding screen, google for 'gnu screen' to find it. -- Danny