Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-soc
Navigation:
Lists: gentoo-soc: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: Robert Buchholz <rbu@g.o>
From: Sérgio Almeida <mephx.x@...>
Subject: Re: Re: Progress on Universal Select Tool
Date: Thu, 23 Jul 2009 19:33:58 +0100
On Thu, 2009-07-23 at 17:28 +0200, Robert Buchholz wrote:
> On Thursday 23 July 2009, Sérgio Almeida wrote:
> > You changedir, you call uprofile, and
> > voila, new profile. You login again, default profile.
> 
> Most shells have the ability to execute a command when a new prompt is 
> generated. Users do not need to call uprofile themselves, they could 
> set up their ~/.*shrc to do this.
> 
> 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 
>               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.
> 
> For bash, you can set a variable:
>        PROMPT_COMMAND If set, the value is executed as a
>                       command prior to issuing each primary prompt.
> 
> 
> You could utilize this to call uprofile, have it output environment 
> variables and set them in the shell environment. A portable (bug ugly, 
> code wise) way would be to do this as part of the PS1 variable.
> 

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... 

if cmd = 'chdir':
  uprofile

This gets me into coding...

What do you guys think?

Cheers,
Sérgio
-- 
Sérgio Almeida - mephx.x@...
mephx @ freenode

Attachment:
signature.asc (This is a digitally signed message part)
References:
Progress on Universal Select Tool
-- Sérgio Almeida
Re: Re: Progress on Universal Select Tool
-- Nirbheek Chauhan
Re: Re: Progress on Universal Select Tool
-- Sérgio Almeida
Re: Re: Progress on Universal Select Tool
-- Robert Buchholz
Navigation:
Lists: gentoo-soc: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Re: Progress on Universal Select Tool
Next by thread:
Re: Re: [gentoo-soc] Re: Progress on Universal Select Tool
Previous by date:
Re: Re: Progress on Universal Select Tool
Next by date:
Re: [GSoC-status] Collagen - database schema and further changes


Updated Sep 12, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.