[openbox] variables in autostart.sh

Josh Glover jmglov at gmail.com
Thu Sep 27 18:59:24 EDT 2007

On 27/09/2007, Bernhard Stoeckner <elven at swordcoast.net> wrote:

> 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

Wow. :)

My solution to the same problem is to stick a few ssh-add commands in
my .xinitrc (one for each key I want ssh-agent to watch), and then
start X like this:

ssh-agent startx; exit

(The exit bit is to ensure that if some wise-ass kills my X server,
they do not get a juicy command prompt.)


More information about the openbox mailing list