mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-20 05:23:20 -07:00
* usr/lib/byobu/include/layout => usr/bin/byobu-layout,
usr/share/byobu/keybindings/f-keys.tmux, usr/share/man/man1/byobu- layout.1: - move the layout library utility to a generally usable byobu-layout in the system path - add specific named layout support to both save and restore operations - add a manpage
This commit is contained in:
parent
9f5879e201
commit
692a34bdf0
4 changed files with 67 additions and 29 deletions
7
debian/changelog
vendored
7
debian/changelog
vendored
|
@ -4,6 +4,13 @@ byobu (5.2) unreleased; urgency=low
|
|||
- save some space in the tarball
|
||||
* usr/lib/byobu/logo:
|
||||
- add a linux mint logo
|
||||
* usr/lib/byobu/include/layout => usr/bin/byobu-layout,
|
||||
usr/share/byobu/keybindings/f-keys.tmux, usr/share/man/man1/byobu-
|
||||
layout.1:
|
||||
- move the layout library utility to a generally usable byobu-layout
|
||||
in the system path
|
||||
- add specific named layout support to both save and restore operations
|
||||
- add a manpage
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 29 Dec 2011 12:28:51 -0600
|
||||
|
||||
|
|
|
@ -69,37 +69,43 @@ case "$1" in
|
|||
printf "$panes\n$layout\n" > "$BYOBU_CONFIG_DIR/layouts/$name"
|
||||
;;
|
||||
"restore")
|
||||
# List the saved layouts, prompt the user to select one
|
||||
list_layouts
|
||||
count="$_RET"
|
||||
while true; do
|
||||
echo -n "Select a layout to restore [1-$count]: "
|
||||
selected=$(head -n1)
|
||||
if [ -n "$selected" ] && [ $selected -le $count ] && [ $selected -ge 1 ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -n "$2" ]; then
|
||||
# Layout selected on the command line
|
||||
name="$2"
|
||||
else
|
||||
# List the saved layouts, prompt the user to select one
|
||||
list_layouts
|
||||
count="$_RET"
|
||||
while true; do
|
||||
echo -n "Select a layout to restore [1-$count]: "
|
||||
selected=$(head -n1)
|
||||
if [ -n "$selected" ] && [ $selected -le $count ] && [ $selected -ge 1 ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
count=0
|
||||
for i in $PRESETS "$DIR"/*; do
|
||||
count=$(expr $count + 1)
|
||||
if [ $count -eq $selected ]; then
|
||||
name=$(basename "$i")
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
# Get the details of the selected layout
|
||||
count=0
|
||||
panes=
|
||||
layout=
|
||||
for i in $PRESETS "$DIR"/*; do
|
||||
count=$(expr $count + 1)
|
||||
if [ $count -eq $selected ]; then
|
||||
if [ -f "$i" ]; then
|
||||
panes=$(head -n1 "$i")
|
||||
layout=$(tail -n1 "$i")
|
||||
else
|
||||
if [ $current_panes -eq 1 ]; then
|
||||
panes=4
|
||||
else
|
||||
panes=0
|
||||
fi
|
||||
layout="$i"
|
||||
fi
|
||||
break
|
||||
if [ -f "$DIR/$name" ]; then
|
||||
panes=$(head -n1 "$DIR/$name")
|
||||
layout=$(tail -n1 "$DIR/$name")
|
||||
else
|
||||
if [ $current_panes -eq 1 ]; then
|
||||
panes=4
|
||||
else
|
||||
panes=0
|
||||
fi
|
||||
done
|
||||
layout="$name"
|
||||
fi
|
||||
# Create panes if nececessary to restore the layout
|
||||
while [ $(tmux list-panes | wc -l) -lt $panes ]; do
|
||||
tmux split-window
|
|
@ -61,8 +61,8 @@ bind-key -n M-NPage copy-mode \; send-keys NPage
|
|||
bind-key -n M-PPage copy-mode \; send-keys PPage
|
||||
bind-key -n F8 command-prompt -p "(rename-window)" "rename-window %%"
|
||||
bind-key -n S-F8 next-layout
|
||||
bind-key -n C-F8 new-window -k "$BYOBU_PREFIX/lib/byobu/include/layout restore; clear; $SHELL"
|
||||
bind-key -n C-S-F8 command-prompt -p "Save byobu layout as:" "run-shell '$BYOBU_PREFIX/lib/byobu/include/layout save %%'"
|
||||
bind-key -n C-F8 new-window -k "byobu-layout restore; clear; $SHELL"
|
||||
bind-key -n C-S-F8 command-prompt -p "Save byobu layout as:" "run-shell 'byobu-layout save %%'"
|
||||
bind-key -n F9 new-window -k -n config byobu-config
|
||||
bind-key -n M-F11 break-pane
|
||||
bind-key -n C-F11 join-pane -h -s :. -t :-1
|
||||
|
|
25
usr/share/man/man1/byobu-layout.1
Normal file
25
usr/share/man/man1/byobu-layout.1
Normal file
|
@ -0,0 +1,25 @@
|
|||
.TH byobu-layout 1 "8 Jan 2012" byobu "byobu"
|
||||
.SH NAME
|
||||
byobu\-layout \- Save and restore byobu-tmux laouts
|
||||
|
||||
.SH USAGE
|
||||
byobu\-layout [save|restore] [name]
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBbyobu\-layout\fP will save and restore \fBbyobu-tmux\fP(1) split window layouts.
|
||||
|
||||
If 'name' is blank, it operates interactively.
|
||||
|
||||
Note that this only works with Byobu when backed by \fBtmux\fP(1), and not \fBscreen\fP(1).
|
||||
|
||||
.SH SEE ALSO
|
||||
\fBbyobu\fP(1), \fBtmux\fP(1)
|
||||
|
||||
.TP
|
||||
\fIhttp://launchpad.net/byobu\fP
|
||||
.PD
|
||||
|
||||
.SH AUTHOR
|
||||
This manpage and the utility were written by Dustin Kirkland <kirkland@ubuntu.com> for Ubuntu systems (but may be used by others). Permission is granted to copy, distribute and/or modify this document and the utility under the terms of the GNU General Public License, Version 3 published by the Free Software Foundation.
|
||||
|
||||
The complete text of the GNU General Public License can be found in \fI/usr/share/common-licenses/GPL\fP on Debian/Ubuntu systems, or in \fI/usr/share/doc/fedora-release-*/GPL\fP on Fedora systems, or on the web at \fIhttp://www.gnu.org/licenses/gpl.txt\fP.
|
Loading…
Add table
Add a link
Reference in a new issue