diff --git a/README.md b/README.md index bf765ba1f..a443e1f10 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ terminal screensavers. The aquarium is the default; choose another scene to chan omz shellsaver # A quiet aquarium full of sea shells omz shellsaver logo # The updater's rainbow logo, bouncing around omz shellsaver hermit # A slightly lost hermit crab -omz shellsaver party # A rainbow stage and a dancing crowd +omz shellsaver party # A rainbow stage and a dancing crowd ``` Press any key or Ctrl-C to return to your shell. Screensavers run only when invoked @@ -261,6 +261,7 @@ Use `omz help` to discover the command, and Tab to complete scene names and opti ```zsh omz shellsaver aquarium --seconds 30 # Stop automatically after 30 seconds omz shellsaver logo --mono # Use the terminal's foreground color +omz shellsaver --list # List scenes (aquarium is the default) omz shellsaver --help # Show all scenes and options ``` diff --git a/lib/cli.zsh b/lib/cli.zsh index bf128ff87..066a72318 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -39,6 +39,7 @@ function _omz { _arguments \ '1:command:' \ '2::scene:(aquarium logo hermit party)' \ + '--list[List available scenes]' \ '--mono[Use the default foreground color]' \ '--seconds[Exit after a number of seconds]:seconds:' \ '--snapshot[Print a plain-text still]::frame:' \ diff --git a/tools/screensaver.zsh b/tools/screensaver.zsh index f71f07742..ebd5e60b6 100644 --- a/tools/screensaver.zsh +++ b/tools/screensaver.zsh @@ -11,18 +11,24 @@ local saved_tty='' key='' blank='' result='' scene='' local -a canvas inks palette + _zshell_list() { + print -r -- 'aquarium Sea shells, a ~ hermit crab, and a quiet current (default). +logo The Oh My Zsh wordmark takes a bouncing coffee break. +hermit A bewildered hermit crab tries to find its working directory. +party A rainbow terminal stage and a crowd of dancing shell fans.' + } + _zshell_usage() { print -r -- 'Oh My Zsh / experimental Shellsavers Usage: omz shellsaver [aquarium|logo|hermit|party] [--mono] [--seconds N] omz shellsaver [aquarium|logo|hermit|party] --snapshot [FRAME] - -aquarium Sea shells, a ~ hermit crab, and a quiet current (default). -logo The Oh My Zsh wordmark takes a bouncing coffee break. -hermit A bewildered hermit crab tries to find its working directory. -party A rainbow terminal stage and a crowd of dancing shell fans. - + omz shellsaver --list +' + _zshell_list + print -r -- ' Any key returns to the shell. Ctrl-C also exits safely. +--list List available scenes and the default. --mono Use the terminal default foreground color. --seconds N Exit automatically after 1-3600 seconds. --snapshot Print a still at 96 columns x 28 rows (no terminal needed). @@ -40,6 +46,7 @@ Nothing is installed or enabled automatically.' while (( $# )); do case "$1" in --help|-h) _zshell_usage; exit 0 ;; + --list) _zshell_list; exit 0 ;; --mono) mono=1 ;; --seconds) shift