[openbox] variables in autostart.sh

Bernhard Stoeckner elven at swordcoast.net
Thu Sep 27 06:14:19 EDT 2007

On Thursday 27 September 2007 11:59:40 Jeff Pohlmeyer wrote:
> On 9/27/07, Sebastian Vahl <ml at deadbabylon.de> wrote:
> > It is possible to set up environment variables in autostart.sh and
> > export them? I'm using kmail and all gpg howtos for kmail are saying
> > that I have to set up this line in ~/.kde/env/gpg-agent.sh:
> > eval $(gpg-agent --daemon)
> > ~/.kde/env isn't source when not starting KDE. So I've inserted this
> > line in my autostart.sh. gpg-agent itself is running but the variable
> > GPG_AGENT_INFO isn't set.
> > Any hints?
> Maybe try adding that line to ~/.xinitrc (or whatever your system calls
> it).
>  - Jeff
> ---
> To unsubscribe, send a blank email to openbox-unsubscribe at icculus.org
> Mailing list archives: http://icculus.org/cgi-bin/ezmlm/ezmlm-cgi?24

I had the same problem a few months back.

The solution, in my opinion, is NOT to add gpg-agent to your xinitrc,
since all ssh connections to your box would then not have the exported stuff available.

Here is what in my zshrc:

# Start a ssh agent, if none is running
[[ -z $(ps x | grep ssh-agent | grep -v grep) ]] && ssh-agent -s >! ~/.ssh-agent -t 1800 && echo "ssh-agent started."
# and source it into the local shell.
[[ -f ~/.ssh-agent ]] && eval $(cat ~/.ssh-agent) > /dev/null

You can put that in your ~/.bashrc after adjusting the syntax accordingly (eg: replace [[ ]] with [ ], >! with >)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
URL: <http://icculus.org/pipermail/openbox/attachments/20070927/95b376a4/attachment.pgp>

More information about the openbox mailing list