3
# byobu-launcher-install
4
# Copyright (C) 2008 Canonical Ltd.
6
# Authors: Nick Barcet <nick.barcet@ubuntu.com>
7
# Dustin Kirkland <kirkland@byobu.org>
9
# This program is free software: you can redistribute it and/or modify
10
# it under the terms of the GNU General Public License as published by
11
# the Free Software Foundation, version 3 of the License.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc"
23
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="@prefix@" || export BYOBU_PREFIX
24
. "${BYOBU_PREFIX}/lib/${PKG}/include/common"
26
FLAG="$BYOBU_CONFIG_DIR/no-logout-on-detach"
38
if [ "$LOGOUT_ON_DETACH" = "1" ]; then
46
$PKG-launcher-uninstall "$1" || true
47
printf "_byobu_sourced=1 . ${BYOBU_PREFIX}/bin/byobu-launch 2>/dev/null || true\n" >> "$1"
50
install_launcher_fish() {
51
$PKG-launcher-uninstall "$1" || true
52
printf "status --is-login; and status --is-interactive; and exec byobu-launcher" >> "$1"
55
# Sanitize the environment
56
$PKG-launcher-uninstall || true
58
# Handle bourne shells, if not set globally in /etc/profile.d
59
if [ ! -h "/etc/profile.d/Z97-$PKG.sh" ]; then
60
# Install in $HOME/.profile unconditionally
61
install_launcher "$HOME/.profile"
62
# Now, install in any shell-specific profiles, if they exist
63
# This list may grow to support other shells
64
for i in ".bash_profile" ".bash_login"; do
65
if [ -w "$HOME/$i" ]; then
66
install_launcher "$HOME/$i"
71
# Install in zprofile if default shell is zsh
74
install_launcher "$HOME/.zprofile"
79
if [ -d "$HOME/.config/fish" ]; then
80
install_launcher_fish "$HOME/.config/fish/config.fish"
83
# Hush login, since we will handle motd printing
84
touch "$HOME"/.hushlogin
85
rm -f "$BYOBU_CONFIG_DIR/disable-autolaunch"
87
# Update the logout/nologout flag
90
# vi: syntax=sh ts=4 noexpandtab