From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1MU37F-00085Q-Fr for garchives@archives.gentoo.org; Thu, 23 Jul 2009 18:34:06 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0B2B7E026F; Thu, 23 Jul 2009 18:34:04 +0000 (UTC) Received: from mail-bw0-f227.google.com (mail-bw0-f227.google.com [209.85.218.227]) by pigeon.gentoo.org (Postfix) with ESMTP id 7BE7BE0266; Thu, 23 Jul 2009 18:34:03 +0000 (UTC) Received: by bwz27 with SMTP id 27so966966bwz.34 for ; Thu, 23 Jul 2009 11:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer; bh=B2myk3eBDn6vE1cXa7DSiGD+Bj36tDYH14UYE+ggvag=; b=P0QunwhYc6S9nMbVyLwFpQfYKRfr8+nO0SfSoJ8GvKgKkXJTONR1V8itBrmh8tfGJ5 Ih0uCHBDNBYR+Qy78dlzF2fG+RDJK69tc6ZqEhMStqt1R4S37lb6W4CZEANo0Ewi42Z2 ZB8d80hKDk9cVdM0iFpOGChapaw3r7Yxe7kQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer; b=AmiYX7p0kcLjANnIK0bT03CUbJNE/1uHgYVJnej4zp69J+EzQUfWeV6Xtz6ecjsbJC TJDIh2Gp2nf1GXPgZZ0N6uIoiSo8XYzV4bggD1uNE+VqrOM8nttBKq4tbirxHia4lE45 pXpy/7pLVKJ4COp6l6j5OcAM0Qw15xPnkvqz4= Received: by 10.103.160.9 with SMTP id m9mr1307050muo.53.1248374042632; Thu, 23 Jul 2009 11:34:02 -0700 (PDT) Received: from ?192.168.127.16? (magdalene.ist.utl.pt [193.136.161.161]) by mx.google.com with ESMTPS id g1sm8896845muf.56.2009.07.23.11.34.00 (version=SSLv3 cipher=RC4-MD5); Thu, 23 Jul 2009 11:34:01 -0700 (PDT) Subject: [gentoo-dev] Re: [gentoo-soc] Re: Progress on Universal Select Tool From: =?ISO-8859-1?Q?S=E9rgio?= Almeida To: Robert Buchholz Cc: gentoo-soc@lists.gentoo.org, Gentoo Dev In-Reply-To: <200907231728.23329.rbu@gentoo.org> References: <1245163715.14589.515.camel@thedude> <8b4c83ad0907222232o6499fcbcjce1d8a063d93d5c1@mail.gmail.com> <1248356100.8713.11.camel@thedude> <200907231728.23329.rbu@gentoo.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-4BB8ROue7/EzjF/2/oJ7" Date: Thu, 23 Jul 2009 19:33:58 +0100 Message-Id: <1248374038.8713.96.camel@thedude> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 X-Archives-Salt: e7dbd0d9-81e7-42a7-967e-47d738c6b1a5 X-Archives-Hash: dbf70d0b6baca54116af362afc8effb6 --=-4BB8ROue7/EzjF/2/oJ7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2009-07-23 at 17:28 +0200, Robert Buchholz wrote: > On Thursday 23 July 2009, S=C3=A9rgio Almeida wrote: > > You changedir, you call uprofile, and > > voila, new profile. You login again, default profile. >=20 > Most shells have the ability to execute a command when a new prompt is=20 > generated. Users do not need to call uprofile themselves, they could=20 > set up their ~/.*shrc to do this. >=20 > For zsh (and tcsh), you can define a function: > chpwd Executed whenever the current working directory is > changed. > precmd Executed before each prompt. Note that precommand=20 > functions are not re-executed simply because the > command line is redrawn, as happens, for example, when > a notification about an exiting job is displayed. >=20 > For bash, you can set a variable: > PROMPT_COMMAND If set, the value is executed as a > command prior to issuing each primary prompt. >=20 >=20 > You could utilize this to call uprofile, have it output environment=20 > variables and set them in the shell environment. A portable (bug ugly,=20 > code wise) way would be to do this as part of the PS1 variable. >=20 This seems interesting... The problem would be to get a unified way of doing this with each and every shell. Can still be done but it's ugly. I'm shure we wouldn't want it to run on every PROMPT but surely on every chdir. We can wrap this into a PROMTP precmd...=20 if cmd =3D 'chdir': uprofile This gets me into coding... What do you guys think? Cheers, S=C3=A9rgio --=20 S=C3=A9rgio Almeida - mephx.x@gmail.com mephx @ freenode --=-4BB8ROue7/EzjF/2/oJ7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkporQsACgkQQXumuXcKj07pZgCeOrjC0zRLAuxUWAqFsbTOddx4 z0EAni7UeMBu1iW3+jDZPbhg3zhpVjHh =1Eud -----END PGP SIGNATURE----- --=-4BB8ROue7/EzjF/2/oJ7--