mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
* bin/byobu-export:
- drop the color selection, no longer necessary
This commit is contained in:
parent
788176d1ce
commit
c426f124cc
2 changed files with 4 additions and 76 deletions
78
byobu-export
78
byobu-export
|
@ -20,8 +20,6 @@
|
||||||
PKG="byobu"
|
PKG="byobu"
|
||||||
SHARE="/usr/share/$PKG"
|
SHARE="/usr/share/$PKG"
|
||||||
DIR=`mktemp -t -d $PKG.XXXXXXXX` || error "Could not create a temporary directory"
|
DIR=`mktemp -t -d $PKG.XXXXXXXX` || error "Could not create a temporary directory"
|
||||||
# Grab list of available colors
|
|
||||||
colors=`find $SHARE/profiles/ -type f | sed "s/^.*\///" | sed "s/^.*-//" | sort -u | egrep -v "common|plain|NONE"`
|
|
||||||
|
|
||||||
# Make sure we clean up $DIR if we exit for any reason
|
# Make sure we clean up $DIR if we exit for any reason
|
||||||
trap "rm -rf "$DIR" 2>/dev/null || true" EXIT HUP INT QUIT TERM
|
trap "rm -rf "$DIR" 2>/dev/null || true" EXIT HUP INT QUIT TERM
|
||||||
|
@ -29,16 +27,11 @@ trap "rm -rf "$DIR" 2>/dev/null || true" EXIT HUP INT QUIT TERM
|
||||||
usage() {
|
usage() {
|
||||||
echo
|
echo
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo " $0 [-c COLOR] -f TARGET.tar.gz"
|
echo " $0 [-f TARGET.tar.gz]"
|
||||||
echo
|
echo
|
||||||
echo "If TARGET.tar.gz is unspecified, a randomly generated"
|
echo "If TARGET.tar.gz is unspecified, a randomly generated"
|
||||||
echo "filename will be used."
|
echo "filename will be used."
|
||||||
echo
|
echo
|
||||||
echo "COLOR is obtained interactively if unspecified; or one of:"
|
|
||||||
for c in $colors; do
|
|
||||||
echo " * $c"
|
|
||||||
done
|
|
||||||
echo
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,43 +41,6 @@ error() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
choose() {
|
|
||||||
i=0
|
|
||||||
x=
|
|
||||||
selected=
|
|
||||||
for x in $@; do
|
|
||||||
i=$(expr $i + 1)
|
|
||||||
[ $i -lt 10 ] && i=" $i"
|
|
||||||
echo " $i. $x" 1>&2
|
|
||||||
done
|
|
||||||
echo
|
|
||||||
count=1
|
|
||||||
while /bin/true; do
|
|
||||||
if [ $count -gt 5 ]; then
|
|
||||||
error "Invalid selection"
|
|
||||||
fi
|
|
||||||
count=`expr $count + 1`
|
|
||||||
if ! test $selected -gt 0 2>/dev/null; then
|
|
||||||
echo -n "`gettext 'Choose'` [1 -$i]: "
|
|
||||||
selected=`head -n1`
|
|
||||||
elif ! test $selected -le $i 2>/dev/null; then
|
|
||||||
echo -n "`gettext 'Choose'` [1 -$i]: "
|
|
||||||
selected=`head -n1`
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
i=0
|
|
||||||
for x in $@; do
|
|
||||||
i=$(expr $i + 1)
|
|
||||||
if [ "$i" = "$selected" ]; then
|
|
||||||
SELECTED="$x"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
hr() {
|
hr() {
|
||||||
echo "###############################################################################"
|
echo "###############################################################################"
|
||||||
}
|
}
|
||||||
|
@ -122,24 +78,18 @@ sources() {
|
||||||
cat $SHARE/profiles/common | sed "s:$PKG-:\$HOME/.$PKG/$PKG-:"
|
cat $SHARE/profiles/common | sed "s:$PKG-:\$HOME/.$PKG/$PKG-:"
|
||||||
hr
|
hr
|
||||||
echo
|
echo
|
||||||
|
# insert the keybindings
|
||||||
cat $SHARE/keybindings/f-keys
|
cat $SHARE/keybindings/f-keys
|
||||||
hr
|
hr
|
||||||
echo
|
echo
|
||||||
hr
|
hr
|
||||||
cat "$SOURCE"
|
|
||||||
hr
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Handle command line parameters
|
# Handle command line parameters
|
||||||
color=
|
|
||||||
file=
|
file=
|
||||||
while [ $# -gt 1 ]; do
|
while [ $# -gt 1 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-c)
|
|
||||||
color="$2"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
-f)
|
-f)
|
||||||
file="$2"
|
file="$2"
|
||||||
shift 2
|
shift 2
|
||||||
|
@ -179,29 +129,6 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Obtain selections
|
|
||||||
count=1
|
|
||||||
while /bin/true; do
|
|
||||||
if [ $count -gt 5 ]; then
|
|
||||||
error "Invalid selection"
|
|
||||||
fi
|
|
||||||
SOURCE="$SHARE"/profiles/"$color"
|
|
||||||
if [ -f "$SOURCE" ]; then
|
|
||||||
break
|
|
||||||
else
|
|
||||||
# Try in the misc directory too
|
|
||||||
SOURCE="$SHARE"/profiles/misc/"$color"
|
|
||||||
if [ -f "$SOURCE" ]; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo
|
|
||||||
echo `gettext "Select a color: "`
|
|
||||||
choose $colors
|
|
||||||
color=$SELECTED
|
|
||||||
count=`expr $count + 1`
|
|
||||||
done
|
|
||||||
|
|
||||||
# Create workspace
|
# Create workspace
|
||||||
PROFILE="$DIR/.screenrc"
|
PROFILE="$DIR/.screenrc"
|
||||||
STATUS="$DIR/.$PKG/status"
|
STATUS="$DIR/.$PKG/status"
|
||||||
|
@ -237,7 +164,6 @@ tar --owner=root --group=root -zcf "$file" -C "$DIR" . || error "Could not creat
|
||||||
echo
|
echo
|
||||||
echo "Success!"
|
echo "Success!"
|
||||||
echo
|
echo
|
||||||
echo " "`gettext "Profile"` ": [$color]"
|
|
||||||
echo " "`gettext "Archive"` ": [$file]"
|
echo " "`gettext "Archive"` ": [$file]"
|
||||||
echo
|
echo
|
||||||
echo `gettext "Extract the archive in your home directory on the target system."`
|
echo `gettext "Extract the archive in your home directory on the target system."`
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -50,6 +50,8 @@ byobu (2.40) unreleased; urgency=low
|
||||||
* byobu-config, byobu-select-profile: make color selection more readable;
|
* byobu-config, byobu-select-profile: make color selection more readable;
|
||||||
support ctrl-<space> escape sequence
|
support ctrl-<space> escape sequence
|
||||||
* bin/custom, byobu-status: support --detail in custom scripts
|
* bin/custom, byobu-status: support --detail in custom scripts
|
||||||
|
* bin/byobu-export:
|
||||||
|
- drop the color selection, no longer necessary
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 10 Nov 2009 10:18:20 -0600
|
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 10 Nov 2009 10:18:20 -0600
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue