From 458e1d313a2c8c137597f2d7d03219a60d09170c Mon Sep 17 00:00:00 2001 From: Srdjan Grubor Date: Mon, 30 Jun 2014 10:45:43 -0500 Subject: [PATCH] Added list command to the byobu-layout Since there is no way to list the layouts other than running 'ls' on the preferences directory, this commits adds the 'list' command to the byobu-layout helper. --- usr/bin/byobu-layout.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/bin/byobu-layout.in b/usr/bin/byobu-layout.in index 8ef746f2..92330eb3 100755 --- a/usr/bin/byobu-layout.in +++ b/usr/bin/byobu-layout.in @@ -29,8 +29,6 @@ PRESETS="even-horizontal even-vertical main-horizontal main-vertical tiled" current_panes=$(tmux list-panes | wc -l) list_layouts() { - echo - echo "Restore layout with , save a layout with " echo echo "Byobu Saved Layouts" local count=0 i= desc= count= p= @@ -52,6 +50,8 @@ case "$1" in if [ -n "$2" ]; then name="$2" else + echo + echo "Restore layout with , save a layout with " while true; do list_layouts echo -n "Enter a unique name to save this layout: " @@ -115,8 +115,12 @@ case "$1" in tmux select-layout "$layout" 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 ;; esac