~ubuntu-branches/debian/wheezy/byobu/wheezy

« back to all changes in this revision

Viewing changes to usr/bin/byobu-reconnect-sockets.orig

  • Committer: Package Import Robot
  • Author(s): Alexander Chernyakhovsky
  • Date: 2012-03-12 00:57:42 UTC
  • mfrom: (0.6.1) (0.1.176 precise)
  • Revision ID: package-import@ubuntu.com-20120312005742-barjtu40fv60w64m
Tags: 5.16-1
Syncing from Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
#
3
 
#    byobu-reconnect-sockets - source this file to re-establish
4
 
#                              GPG_AGENT_INFO and DBUS_SESSION_BUS_ADDRESS,
5
 
#                              useful when reconnecting to an existing
6
 
#                              byobu session.
7
 
#
8
 
#    Copyright (C) 2009 Canonical Ltd.
9
 
#
10
 
#    Authors: Dustin Kirkland <kirkland@ubuntu.com>
11
 
#
12
 
#    This program is free software: you can redistribute it and/or modify
13
 
#    it under the terms of the GNU General Public License as published by
14
 
#    the Free Software Foundation, version 3 of the License.
15
 
#
16
 
#    This program is distributed in the hope that it will be useful,
17
 
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 
#    GNU General Public License for more details.
20
 
#
21
 
#    You should have received a copy of the GNU General Public License
22
 
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
 
 
24
 
PKG="byobu"
25
 
[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc"
26
 
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
27
 
. "${BYOBU_PREFIX}/lib/${PKG}/include/common"
28
 
 
29
 
case "$-" in
30
 
        *i*)
31
 
                # no-op
32
 
        ;;
33
 
        *)
34
 
                echo 2>&1
35
 
                echo "ERROR: You must source this file, rather than execute it." 2>&1
36
 
                echo "  . $0" 2>&1
37
 
                echo 2>&1
38
 
                exit 1
39
 
        ;;
40
 
esac
41
 
 
42
 
# Establish gpg-agent socket, helps when reconnecting to a detached session
43
 
newest "$HOME/.gnupg/"gpg-agent-info-* && . "$_RET" && export GPG_AGENT_INFO
44
 
 
45
 
# Reconnect dbus, source the most recently touched session-bus
46
 
# Sorry, ls -t is needed here, to sort by time
47
 
newest "$HOME/.dbus/session-bus/*" && . "$_RET"
48
 
 
49
 
[ -r "$BYOBU_RUN_DIR/sockets" ] && . "$BYOBU_RUN_DIR/sockets"
50
 
export DBUS_SESSION_DBUS_ADDRESS
51
 
export SESSION_MANAGER
52
 
 
53
 
# vi: syntax=sh ts=4 noexpandtab