Skip to content

Commit 2f3c49e

Browse files
docs: automated dynamic gif previews using vhs (#736)
* use vhs for previews * some improvements * some improvements 2 * forgot about those somehow * and those * better commit message
1 parent 9ffa352 commit 2f3c49e

File tree

6 files changed

+110
-2
lines changed

6 files changed

+110
-2
lines changed

.github/workflows/linutil.yml

+20
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,23 @@ jobs:
8888
env:
8989
version: ${{ env.version }}
9090
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
92+
- name: Install vhs
93+
run: |
94+
wget 'https://github.com/charmbracelet/vhs/releases/download/v0.8.0/vhs_0.8.0_amd64.deb'
95+
sudo apt install -y ffmpeg
96+
sudo snap install ttyd --classic
97+
sudo dpkg -i 'vhs_0.8.0_amd64.deb'
98+
99+
- name: Build the preview
100+
run: |
101+
export PATH="$(pwd)/build:$PATH"
102+
vhs docs/assets/preview.tape -o docs/assets/preview.gif
103+
104+
- name: Upload the preview
105+
uses: stefanzweifel/git-auto-commit-action@v5
106+
with:
107+
commit_message: Preview for ${{ env.version }}
108+
file_pattern: "docs/assets/preview.gif"
109+
add_options: "--force"
110+
if: success()

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!-- TODO: crates.io package here + <br> -->
88
[![Crates.io Version](https://img.shields.io/crates/v/linutil_tui?style=for-the-badge&color=%23af3a03)](https://crates.io/crates/linutil_tui) [![linutil AUR Version](https://img.shields.io/aur/version/linutil?style=for-the-badge&label=%5BAUR%5D%20linutil&color=%23230567ff)](https://aur.archlinux.org/packages/linutil) [![linutil-bin AUR Version](https://img.shields.io/aur/version/linutil-bin?style=for-the-badge&label=%5BAUR%5D%20linutil-bin&color=%23230567ff)](https://aur.archlinux.org/packages/linutil-bin)
99

10-
![Preview](docs/assets/preview.png)
10+
![Preview](docs/assets/preview.gif)
1111

1212
**Linutil** is a distro-agnostic toolbox designed to simplify everyday Linux tasks. It helps you set up applications and optimize your system for specific use cases. The utility is actively developed in Rust 🦀, providing performance and reliability.
1313

docs/assets/preview.gif

1.55 MB
Loading

docs/assets/preview.png

-66.2 KB
Binary file not shown.

docs/assets/preview.tape

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# VHS documentation
2+
#
3+
# Output:
4+
# Output <path>.gif Create a GIF output at the given <path>
5+
# Output <path>.mp4 Create an MP4 output at the given <path>
6+
# Output <path>.webm Create a WebM output at the given <path>
7+
#
8+
# Require:
9+
# Require <string> Ensure a program is on the $PATH to proceed
10+
#
11+
# Settings:
12+
# Set FontSize <number> Set the font size of the terminal
13+
# Set FontFamily <string> Set the font family of the terminal
14+
# Set Height <number> Set the height of the terminal
15+
# Set Width <number> Set the width of the terminal
16+
# Set LetterSpacing <float> Set the font letter spacing (tracking)
17+
# Set LineHeight <float> Set the font line height
18+
# Set LoopOffset <float>% Set the starting frame offset for the GIF loop
19+
# Set Theme <json|string> Set the theme of the terminal
20+
# Set Padding <number> Set the padding of the terminal
21+
# Set Framerate <number> Set the framerate of the recording
22+
# Set PlaybackSpeed <float> Set the playback speed of the recording
23+
# Set MarginFill <file|#000000> Set the file or color the margin will be filled with.
24+
# Set Margin <number> Set the size of the margin. Has no effect if MarginFill isn't set.
25+
# Set BorderRadius <number> Set terminal border radius, in pixels.
26+
# Set WindowBar <string> Set window bar type. (one of: Rings, RingsRight, Colorful, ColorfulRight)
27+
# Set WindowBarSize <number> Set window bar size, in pixels. Default is 40.
28+
# Set TypingSpeed <time> Set the typing speed of the terminal. Default is 50ms.
29+
#
30+
# Sleep:
31+
# Sleep <time> Sleep for a set amount of <time> in seconds
32+
#
33+
# Type:
34+
# Type[@<time>] "<characters>" Type <characters> into the terminal with a
35+
# <time> delay between each character
36+
#
37+
# Keys:
38+
# Escape[@<time>] [number] Press the Escape key
39+
# Backspace[@<time>] [number] Press the Backspace key
40+
# Delete[@<time>] [number] Press the Delete key
41+
# Insert[@<time>] [number] Press the Insert key
42+
# Down[@<time>] [number] Press the Down key
43+
# Enter[@<time>] [number] Press the Enter key
44+
# Space[@<time>] [number] Press the Space key
45+
# Tab[@<time>] [number] Press the Tab key
46+
# Left[@<time>] [number] Press the Left Arrow key
47+
# Right[@<time>] [number] Press the Right Arrow key
48+
# Up[@<time>] [number] Press the Up Arrow key
49+
# Down[@<time>] [number] Press the Down Arrow key
50+
# PageUp[@<time>] [number] Press the Page Up key
51+
# PageDown[@<time>] [number] Press the Page Down key
52+
# Ctrl+<key> Press the Control key + <key> (e.g. Ctrl+C)
53+
#
54+
# Display:
55+
# Hide Hide the subsequent commands from the output
56+
# Show Show the subsequent commands in the output
57+
58+
Output preview.gif
59+
60+
Require linutil
61+
Require sh
62+
63+
Set Shell "bash"
64+
Set FontSize 32
65+
Set Width 3200
66+
Set Height 1800
67+
68+
Sleep 1s
69+
70+
Type "linutil -t compatible" Sleep 1s Enter
71+
72+
Sleep 5s
73+
74+
Left Sleep 2s
75+
Down Sleep 1s
76+
Down Sleep 1s
77+
Down Sleep 1s
78+
Down Sleep 2s
79+
Right Sleep 3s
80+
81+
Type "/" Sleep 1s
82+
Type@200ms "System Cleanup" Sleep 1s Enter
83+
84+
Sleep 2s
85+
Enter Sleep 3s
86+
Type "y" Sleep 15s # CONFIRMATION PROMPT
87+
88+
Escape

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Note that crates installed using `cargo install` require manual updating with `c
6969

7070
After you've ran the command, you should see a GUI on your screen; It will look something like this:
7171

72-
![preview](assets/preview.png)
72+
![preview](assets/preview.gif)
7373

7474
!!! info
7575

0 commit comments

Comments
 (0)