diff --git a/byobu-reconnect-sockets b/byobu-reconnect-sockets new file mode 100755 index 00000000..2647c6b2 --- /dev/null +++ b/byobu-reconnect-sockets @@ -0,0 +1,43 @@ +#!/bin/sh +# +# byobu-reconnect-sockets - source this file to re-establish +# GPG_AGENT_INFO and DBUS_SESSION_BUS_ADDRESS, +# useful when reconnecting to an existing +# byobu session. +# +# Copyright (C) 2009 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +if ! echo $- | grep -qs i; then + echo + echo "ERROR: You must source this file, rather than execute it." + echo " . $0" + echo + #exit 1 +fi + +# Establish gpg-agent socket, helps when reconnecting to a detached session +for i in $(ls "$HOME/.gnupg/"gpg-agent-info-*); do + . "$i" || continue + export GPG_AGENT_INFO && break +done + +# Reconnect dbus, source the most recently touched session-bus +for i in $(ls -t "$HOME/.dbus/session-bus/" 2>/dev/null); do + . "$HOME/.dbus/session-bus/$i" || continue + export DBUS_SESSION_BUS_ADDRESS && break +done diff --git a/byobu-reconnect-sockets.1 b/byobu-reconnect-sockets.1 new file mode 100644 index 00000000..6a845ef3 --- /dev/null +++ b/byobu-reconnect-sockets.1 @@ -0,0 +1,17 @@ +.TH byobu-reconnect-sockets 1 "7 Dec 2009" byobu "byobu" +.SH NAME +byobu\-reconnect\-sockets \- Sourcable script that updates GPG_AGENT_INFO and DBUS_SESSION_BUS_ADDRESS in the environment + +.SH DESCRIPTION +\fBbyobu\-reconnect\-sockets\fP is a sourcable bit of shell code that will update the GPG_AGENT_INFO and DBUS_SESSION_BUS_ADDRESS environment variables in the current shell, such that you may restablish connection to \fBgpg\-agent\fP(1) and \fBdbus\-daemon(1)\fP. + +This is often useful when reattaching to a detached Byobu session. + +.TP +\fIhttp://launchpad.net/byobu\fP +.PD + +.SH AUTHOR +This manpage and the utility were written by Dustin Kirkland for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 published by the Free Software Foundation. + +On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. diff --git a/debian/changelog b/debian/changelog index 4a712fef..3395655d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -52,6 +52,9 @@ byobu (2.40) unreleased; urgency=low * bin/custom, byobu-status: support --detail in custom scripts * bin/byobu-export: - drop the color selection, no longer necessary + * byobu-reconnect-sockets, byobu-reconnect-sockets.1, debian/install, + debian/rules: create a sourcable shell script that updates the gpg-agent + and dbus socket environment variables, LP: #486511 -- Dustin Kirkland Tue, 10 Nov 2009 10:18:20 -0600 diff --git a/debian/install b/debian/install index a1236e90..d21a8f40 100644 --- a/debian/install +++ b/debian/install @@ -10,6 +10,7 @@ windows/common usr/share/byobu/windows byobu-select-profile usr/bin byobu usr/bin byobu-config usr/bin +byobu-reconnect-sockets usr/bin byobu-status usr/bin byobu-status-detail usr/bin byobu-janitor usr/bin diff --git a/debian/rules b/debian/rules index a665850c..74669616 100755 --- a/debian/rules +++ b/debian/rules @@ -56,7 +56,7 @@ binary-indep: build install dh_testdir -i dh_testroot -i dh_installdocs -X.bzr -i - dh_installman -i byobu-launcher.1 byobu.1 byobu-config.1 byobu-select-profile.1 motd+shell.1 byobu-export.1 byobu-status.1 byobu-status-detail.1 + dh_installman -i byobu-launcher.1 byobu.1 byobu-config.1 byobu-select-profile.1 motd+shell.1 byobu-export.1 byobu-status.1 byobu-status-detail.1 byobu-reconnect-sockets.1 dh_installchangelogs -i dh_installdebconf -i dh_compress -i