* usr/bin/byobu-layout.in:

- add a list-layouts command
This commit is contained in:
Dustin Kirkland 2014-08-05 22:15:44 +02:00
commit 7dceb557b8
2 changed files with 11 additions and 3 deletions

4
debian/changelog vendored
View file

@ -9,6 +9,10 @@ byobu (5.85) unreleased; urgency=medium
session names start with an underscore, adding this feature to tmux session names start with an underscore, adding this feature to tmux
based byobu. based byobu.
[ Srdjan Grubor ]
* usr/bin/byobu-layout.in:
- add a list-layouts command
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 28 Jul 2014 09:12:13 +0100 -- Dustin Kirkland <kirkland@ubuntu.com> Mon, 28 Jul 2014 09:12:13 +0100
byobu (5.84-0ubuntu1) utopic; urgency=medium byobu (5.84-0ubuntu1) utopic; urgency=medium

View file

@ -29,8 +29,6 @@ PRESETS="even-horizontal even-vertical main-horizontal main-vertical tiled"
current_panes=$(tmux list-panes | wc -l) current_panes=$(tmux list-panes | wc -l)
list_layouts() { list_layouts() {
echo
echo "Restore layout with <shift-F8>, save a layout with <shift-ctrl-F8>"
echo echo
echo "Byobu Saved Layouts" echo "Byobu Saved Layouts"
local count=0 i= desc= count= p= local count=0 i= desc= count= p=
@ -52,6 +50,8 @@ case "$1" in
if [ -n "$2" ]; then if [ -n "$2" ]; then
name="$2" name="$2"
else else
echo
echo "Restore layout with <shift-F8>, save a layout with <shift-ctrl-F8>"
while true; do while true; do
list_layouts list_layouts
echo -n "Enter a unique name to save this layout: " echo -n "Enter a unique name to save this layout: "
@ -115,8 +115,12 @@ case "$1" in
tmux select-layout "$layout" tmux select-layout "$layout"
tmux source "$BYOBU_PREFIX/share/byobu/profiles/tmuxrc" tmux source "$BYOBU_PREFIX/share/byobu/profiles/tmuxrc"
;; ;;
list)
list_layouts
exit 0
;;
*) *)
echo "ERROR: Invalid argument, try [save|restore]" 2>&1 echo "ERROR: Invalid argument, try [save|restore|list]" 2>&1
exit 1 exit 1
;; ;;
esac esac