diff --git a/README.md b/README.md index 20b4854f..fb4f4fa1 100644 --- a/README.md +++ b/README.md @@ -673,6 +673,21 @@ Set CursorBlink false Example of setting the cursor blink. +#### ProgressBar + +Add a one-pixel progress bar at the bottom of the SVG terminal viewport: + +```elixir +Set ProgressBar "#9B79FF" +``` + +Use a quoted `#RGB`, `#RRGGBB`, or `#RRGGBBAA` hex color. The bar is off by +default and applies only to SVG output. It uses the terminal animation's +`PlaybackSpeed` and `LoopOffset` timing. + +Browsers animate the bar during playback. Static renderers such as librsvg and +Inkscape display a full-width bar without playback animation. + ### Type Use `Type` to emulate key presses. That is, you can use `Type` to script typing diff --git a/command.go b/command.go index 35f3bea4..b71182d5 100644 --- a/command.go +++ b/command.go @@ -498,6 +498,7 @@ var Settings = map[string]CommandFunc{ "WaitPattern": ExecuteSetWaitPattern, "WaitTimeout": ExecuteSetWaitTimeout, "CursorBlink": ExecuteSetCursorBlink, + "ProgressBar": ExecuteSetProgressBar, } // ExecuteSet applies the settings on the running vhs specified by the @@ -764,6 +765,12 @@ func ExecuteSetMarginFill(c parser.Command, v *VHS) error { return nil } +// ExecuteSetProgressBar sets the progress bar color. +func ExecuteSetProgressBar(c parser.Command, v *VHS) error { + v.Options.Video.Style.ProgressBarColor = c.Args + return nil +} + // ExecuteSetMargin sets vhs margin size. func ExecuteSetMargin(c parser.Command, v *VHS) error { margin, err := strconv.Atoi(c.Args) diff --git a/man.go b/man.go index 8eb13787..7c9336a1 100644 --- a/man.go +++ b/man.go @@ -77,6 +77,7 @@ The following is a list of all possible setting commands in VHS: * Set %Padding% * Set %Framerate% * Set %PlaybackSpeed% +* Set %ProgressBar% "" * Set %WaitTimeout%