From 9ab722ca4fe1e248283091626bd9fe5ecea65e1b Mon Sep 17 00:00:00 2001 From: Maas Lalani Date: Fri, 5 Apr 2024 02:32:11 -0400 Subject: [PATCH] chore: new gifs (JetBrains Mono) --- README.md | 4 ++-- examples/.gitignore | 1 + examples/commit.sh | 6 +++--- examples/commit.tape | 45 ++++++++++++++++++++++++++++++++++++++++ examples/demo.sh | 13 ++++++------ examples/demo.tape | 49 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 106 insertions(+), 12 deletions(-) create mode 100644 examples/.gitignore create mode 100644 examples/commit.tape create mode 100644 examples/demo.tape diff --git a/README.md b/README.md index f5c271a87..9dd697588 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ A tool for glamorous shell scripts. Leverage the power of Gloss](https://github.com/charmbracelet/lipgloss) in your scripts and aliases without writing any Go code! -Shell running the ./demo.sh script +Shell running the ./demo.sh script The above example is running from a single shell script ([source](./examples/demo.sh)). @@ -51,7 +51,7 @@ gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION" For a working version of the script see how it is all [put together](https://github.com/charmbracelet/gum/blob/main/examples/commit.sh) in a single script. -Running the ./examples/commit.sh script to commit to git +Running the ./examples/commit.sh script to commit to git ## Installation diff --git a/examples/.gitignore b/examples/.gitignore new file mode 100644 index 000000000..2d0c92986 --- /dev/null +++ b/examples/.gitignore @@ -0,0 +1 @@ +*.gif diff --git a/examples/commit.sh b/examples/commit.sh index 29ab94c05..1252fc9c3 100755 --- a/examples/commit.sh +++ b/examples/commit.sh @@ -10,9 +10,9 @@ # # alias gcm='git commit -m "$(gum input)" -m "$(gum write)"' -if [ -z "$(git status -s -uno | grep -v '^ ' | awk '{print $2}')" ]; then - gum confirm "Stage all?" && git add . -fi +# if [ -z "$(git status -s -uno | grep -v '^ ' | awk '{print $2}')" ]; then +# gum confirm "Stage all?" && git add . +# fi TYPE=$(gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert") SCOPE=$(gum input --placeholder "scope") diff --git a/examples/commit.tape b/examples/commit.tape new file mode 100644 index 000000000..b7d7e9c90 --- /dev/null +++ b/examples/commit.tape @@ -0,0 +1,45 @@ +Output commit.gif + +Set Shell "bash" +Set FontSize 32 +Set Width 1200 +Set Height 600 + +Type "./commit.sh" Sleep 500ms Enter + +Sleep 1s +Down@250ms 2 +Sleep 500ms +Enter + +Sleep 500ms + +Type "gum" + +Sleep 500ms +Enter + +Sleep 1s + +Type "Gum is sooo tasty" +Sleep 500ms + +Enter + +Sleep 1s + +Type@65ms "I love bubble gum." +Sleep 500ms +Alt+Enter +Sleep 500ms +Alt+Enter +Sleep 500ms +Type "This commit shows how much I love chewing bubble gum!!!" +Sleep 500ms +Enter + +Sleep 1s + +Left@400ms 3 + +Sleep 1s diff --git a/examples/demo.sh b/examples/demo.sh index 9a7c3ca1c..132dd795f 100755 --- a/examples/demo.sh +++ b/examples/demo.sh @@ -5,7 +5,7 @@ NAME=$(gum input --placeholder "What is your name?") echo -e "Well, it is nice to meet you, $(gum style --foreground 212 "$NAME")." -sleep 2; clear +sleep 1; clear echo -e "Can you tell me a $(gum style --italic --foreground 99 'secret')?\n" @@ -14,7 +14,7 @@ gum write --placeholder "I'll keep it to myself, I promise!" > /dev/null # we ke clear; echo "What should I do with this information?"; sleep 1 READ="Read"; THINK="Think"; DISCARD="Discard" -ACTIONS=$(gum choose --cursor-prefix "[ ] " --selected-prefix "[✓] " --no-limit "$READ" "$THINK" "$DISCARD") +ACTIONS=$(gum choose --no-limit "$READ" "$THINK" "$DISCARD") clear; echo "One moment, please." @@ -24,8 +24,7 @@ grep -q "$DISCARD" <<< "$ACTIONS" && gum spin -s monkey --title " Discarding you sleep 1; clear -echo "What's your favorite $(gum style --foreground 212 "Gum") flavor?" -GUM=$(echo -e "Cherry\nGrape\nLime\nOrange" | gum filter) +GUM=$(echo -e "Cherry\nGrape\nLime\nOrange" | gum filter --placeholder "Favorite flavor?") echo "I'll keep that in mind!" sleep 1; clear @@ -39,10 +38,10 @@ CHOICE=$(gum choose --item.foreground 250 "Yes" "No" "It's complicated") sleep 1 -gum spin --title "Chewing some $(gum style --foreground "#04B575" "$GUM") bubble gum..." -- sleep 5 +gum spin --title "Chewing some $(gum style --foreground "#04B575" "$GUM") bubble gum..." -- sleep 2.5 clear -NICE_MEETING_YOU=$(gum style --height 5 --width 25 --padding '1 3' --border double --border-foreground 57 "Well, it was nice meeting you, $(gum style --foreground 212 "$NAME"). Hope to see you soon!") -CHEW_BUBBLE_GUM=$(gum style --width 25 --padding '1 3' --border double --border-foreground 212 "Don't forget to chew some $(gum style --foreground "#04B575" "$GUM") bubble gum.") +NICE_MEETING_YOU=$(gum style --height 5 --width 20 --padding '1 3' --border double --border-foreground 57 "Nice meeting you, $(gum style --foreground 212 "$NAME"). See you soon!") +CHEW_BUBBLE_GUM=$(gum style --width 17 --padding '1 3' --border double --border-foreground 212 "Go chew some $(gum style --foreground "#04B575" "$GUM") bubble gum.") gum join --horizontal "$NICE_MEETING_YOU" "$CHEW_BUBBLE_GUM" diff --git a/examples/demo.tape b/examples/demo.tape new file mode 100644 index 000000000..fe8d27da7 --- /dev/null +++ b/examples/demo.tape @@ -0,0 +1,49 @@ +Output ./demo.gif + +Set Shell bash + +Set FontSize 22 +Set Width 800 +Set Height 450 + +Type "./demo.sh" +Enter +Sleep 1s +Type "Walter" +Sleep 500ms +Enter + +Sleep 2s + +Type "Nope, sorry!" +Sleep 500ms +Alt+Enter +Sleep 200ms +Alt+Enter +Sleep 500ms +Type "I don't trust you." +Sleep 1s +Enter + +Sleep 2s + +Type "x" Sleep 250ms Type "j" Sleep 250ms +Type "x" Sleep 250ms Type "j" Sleep 250ms +Type "x" Sleep 1s + +Enter + +Sleep 6s + +Type "li" +Sleep 1s +Enter + +Sleep 3s +Down@500ms 2 +Up@500ms 2 +Sleep 1s +Enter + + +Sleep 6s