mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
* usr/bin/byobu-config, usr/bin/byobu-janitor, usr/bin/byobu-launcher-
uninstall, usr/share/byobu/keybindings/f-keys: - use gsed, where available; should help with BSD issues running byobu, LP: #651993
This commit is contained in:
parent
d53379918e
commit
8107b79d6d
5 changed files with 27 additions and 14 deletions
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -12,6 +12,10 @@ byobu (3.7) unreleased; urgency=low
|
|||
- allow for disabling the notify_osd status; must handle in the perl
|
||||
script
|
||||
- use BYOBU_PREFIX for local installs
|
||||
* usr/bin/byobu-config, usr/bin/byobu-janitor, usr/bin/byobu-launcher-
|
||||
uninstall, usr/share/byobu/keybindings/f-keys:
|
||||
- use gsed, where available; should help with BSD issues running byobu,
|
||||
LP: #651993
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 21 Oct 2010 12:09:14 -0500
|
||||
|
||||
|
|
|
@ -52,7 +52,10 @@ RELOAD_CMD="screen -X at 0 source $HOME/."+PKG+"/profile"
|
|||
ESC = ''
|
||||
snack.hotkeys[ESC] = ord(ESC)
|
||||
snack.hotkeys[ord(ESC)] = ESC
|
||||
|
||||
if commands.getstatusoutput('which gsed')[0] == 0:
|
||||
SED = "gsed"
|
||||
else:
|
||||
SED = "sed"
|
||||
gettext.bindtextdomain(PKG, SHARE+'/po')
|
||||
gettext.textdomain(PKG)
|
||||
_ = gettext.gettext
|
||||
|
@ -137,7 +140,7 @@ def help(screen, size, config):
|
|||
f.close()
|
||||
|
||||
text=text.replace("<esckey>", getesckey(), 1)
|
||||
text=text.replace("_VER_", commands.getoutput("byobu -v | head -n1 | sed 's/.* //'"), 1)
|
||||
text=text.replace("_VER_", commands.getoutput("byobu -v | head -n1 | " + SED + " 's/.* //'"), 1)
|
||||
|
||||
t = Textbox(70, 14, text, scroll=0)
|
||||
bb = ButtonBar(screen, ((_("Menu"), "menu", ESC),), compact = 1)
|
||||
|
@ -190,7 +193,7 @@ def keybindings(screen, size):
|
|||
return 100
|
||||
|
||||
def switch_keybindings(set):
|
||||
commands.getoutput("sed -i -e 's:^source .*$:source "+SHARE+"/keybindings/"+set+":' "+HOME+"/."+PKG+"/keybindings")
|
||||
commands.getoutput(SED + " -i -e 's:^source .*$:source "+SHARE+"/keybindings/"+set+":' "+HOME+"/."+PKG+"/keybindings")
|
||||
|
||||
def newwindow(screen, size):
|
||||
title=Entry(8, text="shell", returnExit=1)
|
||||
|
@ -463,13 +466,13 @@ def setesckey(key):
|
|||
u = key[0].upper()
|
||||
l = key[0].lower()
|
||||
if os.path.exists(path):
|
||||
out = commands.getoutput("sed -i -e 's/^escape.*$//' "+path)
|
||||
out = commands.getoutput(SED+" -i -e 's/^escape.*$//' "+path)
|
||||
appendtofile(path, "escape ^"+u+l+"\n")
|
||||
out = commands.getoutput("sed -i -e 's/^register.*$//' "+path)
|
||||
out = commands.getoutput(SED+" -i -e 's/^register.*$//' "+path)
|
||||
out = commands.getoutput("grep -h ^register "+SHARE+"/keybindings/*keys")
|
||||
appendtofile(path, out+"\n")
|
||||
out = commands.getoutput("sed -i -e 's/\"\^a/\"\^"+l+"/g' "+path)
|
||||
out = commands.getoutput("sed -i -e '/^$/d' "+path)
|
||||
out = commands.getoutput(SED+" -i -e 's/\"\^a/\"\^"+l+"/g' "+path)
|
||||
out = commands.getoutput(SED+" -i -e '/^$/d' "+path)
|
||||
|
||||
def chgesc(screen, size):
|
||||
esc=Entry(2, text=getesckey(), returnExit=1)
|
||||
|
|
|
@ -25,6 +25,9 @@ PKG="byobu"
|
|||
RUN="$SOCKETDIR/S-$USER"
|
||||
FLAG="$RUN/$PKG.reload-required"
|
||||
|
||||
# Use gsed on non-Linux OS's
|
||||
which gsed 2>/dev/null && SED="gsed" || SED="sed"
|
||||
|
||||
# Exit immediately, if we're not forced, and there is no reload flag
|
||||
if [ "$1" != "--force" ] && [ ! -e "$FLAG" ]; then
|
||||
exit 0
|
||||
|
@ -111,9 +114,9 @@ fi
|
|||
# The status scripts used to have hyphens in their name, but now use
|
||||
# underscores such that we can source the file as a shell snippet;
|
||||
# fix existing status configuration.
|
||||
sed -i -e "s/\([^=]+\)-\([^=]+\)=/\1_\2=/g" "$HOME/.$PKG/status"
|
||||
sed -i -e "s/^disk-.*=/disk=/" "$HOME/.$PKG/status"
|
||||
sed -i -e "s/^network-.*=/network=/" "$HOME/.$PKG/status"
|
||||
$SED -i -e "s/\([^=]+\)-\([^=]+\)=/\1_\2=/g" "$HOME/.$PKG/status"
|
||||
$SED -i -e "s/^disk-.*=/disk=/" "$HOME/.$PKG/status"
|
||||
$SED -i -e "s/^network-.*=/network=/" "$HOME/.$PKG/status"
|
||||
|
||||
# Affects: Upgrades from <= byobu-2.16
|
||||
# screen-launcher was renamed byobu-launcher; if the user has byobu
|
||||
|
@ -142,7 +145,7 @@ done
|
|||
# Affects: Upgrades from <= byobu-2.57 that autolaunch
|
||||
# If the global autolaunch is on, then remove duplicate entry in ~/.profile
|
||||
if [ -h "/etc/profile.d/Z98-$PKG.sh" ]; then
|
||||
sed -i -e "/ $PKG-launcher/d" "$HOME"/.profile || true
|
||||
$SED -i -e "/ $PKG-launcher/d" "$HOME"/.profile || true
|
||||
fi
|
||||
|
||||
# Affects: Upgrades from <= byobu-2.70 that autolaunch
|
||||
|
@ -154,7 +157,7 @@ fi
|
|||
# Affects: Upgrades from <= byobu-2.78 which might have "motd+shell"
|
||||
# in their window list; update this to just "shell"
|
||||
if grep -qs "motd+shell" "$HOME/.$PKG/windows"; then
|
||||
sed -i -e "s/motd+shell/shell/g" "$HOME/.$PKG/windows" || true
|
||||
$SED -i -e "s/motd+shell/shell/g" "$HOME/.$PKG/windows" || true
|
||||
fi
|
||||
|
||||
# Clean up flag
|
||||
|
|
|
@ -20,10 +20,13 @@
|
|||
|
||||
PKG="byobu"
|
||||
|
||||
# Use gsed on non-Linux OS's
|
||||
which gsed 2>/dev/null && SED="gsed" || SED="sed"
|
||||
|
||||
remove_launcher() {
|
||||
dest=$1
|
||||
if [ -w "$dest" ]; then
|
||||
sed -i -e "/ $PKG-launcher/d" -e "/ screen-launcher/d" "$dest"
|
||||
$SED -i -e "/ $PKG-launcher/d" -e "/ screen-launcher/d" "$dest"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ bind $ screen -t status 0 byobu-status-detail # ctrl-a $ | show detailed statu
|
|||
bind @ screen -t config 0 byobu-config # ctrl-a @ | Configuration
|
||||
bind R process r # ctrl-a R | Reload profile
|
||||
register s "^a[g G$>^h" # Goes with ^a~ definition
|
||||
bind ~ eval 'process s' 'exec sed -i -e "/./,/^$/!d" /var/run/screen/S-$USER/byobu-exchange' 'echo "See: /var/run/screen/S-$USER/byobu-exchange"' # ctrl-a ~ | write the buffer to file
|
||||
bind ~ eval 'process s' 'exec $(which gsed || printf sed) -i -e "/./,/^$/!d" /var/run/screen/S-$USER/byobu-exchange' 'echo "See: /var/run/screen/S-$USER/byobu-exchange"' # ctrl-a ~ | write the buffer to file
|
||||
|
||||
# toggle f-key keybindings off
|
||||
register d "^a:source $BYOBU_PREFIX/share/byobu/keybindings/screen-escape-keys^M"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue