From 9904f65ffe6290d39eb2825214d676d5c1c7a110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Thu, 14 Oct 2021 22:58:09 +0200 Subject: [PATCH 01/13] Proof of concept MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- docs/bak.tut | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 docs/bak.tut diff --git a/docs/bak.tut b/docs/bak.tut new file mode 100644 index 0000000..8389352 --- /dev/null +++ b/docs/bak.tut @@ -0,0 +1,111 @@ +#!/usr/bin/env tuterm + +export PYTHONPATH="$(pip show bak | grep 'Location:' | sed 's/Location: //')" +USER_HOME="$HOME" + +configure() { + DELAY='0.05s' + DELAY_SEP='0.2s' + DELAY_PROMPT='1s' +} + +bak() { + python "$PYTHONPATH"/bak/__main__.py "$@" +} + +editor() { + if mode tutorial; then + "$EDITOR" "$@" + else + # This is a bit of a hack + timeout 2.5 tmux new-session "$EDITOR +'set ft=sh' $*" >/dev/null + fi +} + +run() { + # Prepare the working environment + mkdir -p ~/.config + cp "$USER_HOME/.config/bak.cfg.default" ~/.config/ + if mode demo; then + EDITOR="vim" + echo "set -g status off" > ~/.tmux.conf + fi + echo -e "- [X] Install bak\n- [X] Make my life easier" > todo.txt + +# ┏━━━━━━━━━━━━━━━━━━━━━┓ +# ┃ Tutorial/demo start ┃ +# ┗━━━━━━━━━━━━━━━━━━━━━┛ + if mode tutorial; then + m "-- bak tutorial start --" + echo + else + M "-- bak demo start --" + echo + fi + # Expected-command tracker + c ls + c cat todo.txt + sleep 1 + + echo + M "Backup todo.txt" + c bak todo.txt # + if mode tutorial; then sleep 1; fi + m + m "<< You won't usually have to know where bakfiles are >>" + m + if mode tutorial; then sleep 1; fi + m "Let's make a change to the file" + + echo "- [ ] Take out trash # Freshly added" >> todo.txt + e "$EDITOR" todo.txt # + editor todo.txt + M "Let's back up the changes" + c bak todo.txt # + c bak list todo.txt # + + echo + sleep 1 + M "Let's restore the file from entry #1 (the original)" + e bak down todo.txt 1 # + if mode tutorial; then + bak down todo.txt 1 + else + # workaround to inadequate stdout message + echo -ne "Confirm: Restore /tmp/tuterm/home1/todo.txt" \ + "from bakfile #1 and bakfiles ? [y/N]:" + sleep 1 + echo " y" + sleep 0.3 + echo "1 bakfiles discarded" + { sleep 1 && yes; } | bak down todo.txt 1 >/dev/null + fi + echo + c cat todo.txt # + + if mode demo; then + echo + M "-- bak demo end --" + exit + fi +# ┏━━━━━━━━━━┓ +# ┃ Demo end ┃ +# ┗━━━━━━━━━━┛ + + m "Let's see where the backup is located:" + c bak where todo.txt # + + m "We're done here" + c bak off todo.txt # + + m "If you have any questions, just run:" + c bak # + + m + m "-- bak tutorial end --" +# ┏━━━━━━━━━━━━━━┓ +# ┃ Tutorial end ┃ +# ┗━━━━━━━━━━━━━━┛ +} + +# vim: filetype=sh From a80a93895ce63f311a74bc6e9703271cec4ec421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 13:41:16 +0200 Subject: [PATCH 02/13] Small tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- docs/bak.tut | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/docs/bak.tut b/docs/bak.tut index 8389352..d50b034 100644 --- a/docs/bak.tut +++ b/docs/bak.tut @@ -4,9 +4,11 @@ export PYTHONPATH="$(pip show bak | grep 'Location:' | sed 's/Location: //')" USER_HOME="$HOME" configure() { - DELAY='0.05s' - DELAY_SEP='0.2s' - DELAY_PROMPT='1s' + if mode demo; then + DELAY='0.05s' + DELAY_SEP='0.2s' + DELAY_PROMPT='1s' + fi } bak() { @@ -42,9 +44,9 @@ run() { M "-- bak demo start --" echo fi - # Expected-command tracker + # Command tracker c ls - c cat todo.txt + c cat todo.txt # sleep 1 echo @@ -55,7 +57,7 @@ run() { m "<< You won't usually have to know where bakfiles are >>" m if mode tutorial; then sleep 1; fi - m "Let's make a change to the file" + M "Change the file" echo "- [ ] Take out trash # Freshly added" >> todo.txt e "$EDITOR" todo.txt # @@ -66,19 +68,14 @@ run() { echo sleep 1 - M "Let's restore the file from entry #1 (the original)" + M "Restore the file from entry #1 (the original)" e bak down todo.txt 1 # if mode tutorial; then bak down todo.txt 1 else - # workaround to inadequate stdout message - echo -ne "Confirm: Restore /tmp/tuterm/home1/todo.txt" \ - "from bakfile #1 and bakfiles ? [y/N]:" - sleep 1 - echo " y" - sleep 0.3 echo "1 bakfiles discarded" - { sleep 1 && yes; } | bak down todo.txt 1 >/dev/null + { sleep 1 && yes; } | bak down todo.txt 1 + echo y fi echo c cat todo.txt # From 19a5b974f245a8bc667dd6bbdd61d5cc67bbf37a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 14:10:40 +0200 Subject: [PATCH 03/13] Add create_svg.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- docs/create_svg.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docs/create_svg.sh diff --git a/docs/create_svg.sh b/docs/create_svg.sh new file mode 100644 index 0000000..eac17f1 --- /dev/null +++ b/docs/create_svg.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env sh + +RECORDED_COMMAND="tuterm bak.tut --mode demo" + +rm -f /tmp/bakfile_bak.cast +asciinema rec -c "$RECORDED_COMMAND" /tmp/bakfile_bak.cast +cat /tmp/bakfile_bak.cast | svg-term --out bak_demo.svg From 013180d59079537869249831b3c1e8c54823db01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 18:23:05 +0200 Subject: [PATCH 04/13] Change and rename create_svg.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- docs/asciinema_upload_and_create_svg.sh | 24 ++++++++++++++++++++++++ docs/create_svg.sh | 7 ------- 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 docs/asciinema_upload_and_create_svg.sh delete mode 100644 docs/create_svg.sh diff --git a/docs/asciinema_upload_and_create_svg.sh b/docs/asciinema_upload_and_create_svg.sh new file mode 100644 index 0000000..1b36b59 --- /dev/null +++ b/docs/asciinema_upload_and_create_svg.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env sh + +# Dependencies: +# - asciinema (https://github.com/asciinema/asciinema) +# - svg-term (https://github.com/marionebl/svg-term-cli) +# - xsel + +# Since you are here, please also look at tuterm: +# https://github.com/veracioux/tuterm + +RECORDED_COMMAND="tuterm bak.tut --mode demo" +alias copy='xsel -b' + +rm -f /tmp/bakfile_bak.cast +# Record the command +asciinema rec -c "$RECORDED_COMMAND" /tmp/bakfile_bak.cast +cat /tmp/bakfile_bak.cast | svg-term --out bak_demo.svg +# Upload to asciinema.org +output="$(asciinema upload /tmp/bakfile_bak.cast)" + +echo "$output" + +# Copy to clipboard +echo "$output" | grep 'https:' | sed 's/^\s*//' | copy diff --git a/docs/create_svg.sh b/docs/create_svg.sh deleted file mode 100644 index eac17f1..0000000 --- a/docs/create_svg.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env sh - -RECORDED_COMMAND="tuterm bak.tut --mode demo" - -rm -f /tmp/bakfile_bak.cast -asciinema rec -c "$RECORDED_COMMAND" /tmp/bakfile_bak.cast -cat /tmp/bakfile_bak.cast | svg-term --out bak_demo.svg From fabdfd757dbe565cc7c52fe0af07db2a619e8d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 18:23:54 +0200 Subject: [PATCH 05/13] Remove start/end messages in demo mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- docs/bak.tut | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/bak.tut b/docs/bak.tut index d50b034..512559f 100644 --- a/docs/bak.tut +++ b/docs/bak.tut @@ -40,9 +40,6 @@ run() { if mode tutorial; then m "-- bak tutorial start --" echo - else - M "-- bak demo start --" - echo fi # Command tracker c ls @@ -81,8 +78,6 @@ run() { c cat todo.txt # if mode demo; then - echo - M "-- bak demo end --" exit fi # ┏━━━━━━━━━━┓ From ef600e6a6eba2994f1d33f599d7efe94dfd2772a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 18:24:37 +0200 Subject: [PATCH 06/13] Add README for demos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- docs/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 docs/README.md diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..ba8d35a --- /dev/null +++ b/docs/README.md @@ -0,0 +1,23 @@ +To run a non-interactive demo: + +```shell +tuterm bak.tut --mode demo +``` + +To run an interactive tutorial: + +```shell +tuterm bak.tut +``` + +To upload the demo to asciinema and create an SVG animated image: + +``` +./asciinema_upload_and_create_svg.sh +``` + +This will copy the asciinema URL to your clipboard and print it to your +terminal. The SVG animation is created as `./bak_demo.svg`. + +You should preview the demo first to verify it, so as to avoid uploading content +unnecessarily. From 4572125e01fd22eca928c7db3ef64ebb0e7a9eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 19:39:41 +0200 Subject: [PATCH 07/13] Move demo files to docs/demo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- docs/{ => demo}/README.md | 0 .../asciinema_upload_and_create_svg.sh | 0 docs/demo/bak.cast | 145 ++++++++++++++++++ docs/{ => demo}/bak.tut | 6 +- docs/demo/bak_demo.svg | 1 + 5 files changed, 151 insertions(+), 1 deletion(-) rename docs/{ => demo}/README.md (100%) rename docs/{ => demo}/asciinema_upload_and_create_svg.sh (100%) create mode 100644 docs/demo/bak.cast rename docs/{ => demo}/bak.tut (94%) create mode 100644 docs/demo/bak_demo.svg diff --git a/docs/README.md b/docs/demo/README.md similarity index 100% rename from docs/README.md rename to docs/demo/README.md diff --git a/docs/asciinema_upload_and_create_svg.sh b/docs/demo/asciinema_upload_and_create_svg.sh similarity index 100% rename from docs/asciinema_upload_and_create_svg.sh rename to docs/demo/asciinema_upload_and_create_svg.sh diff --git a/docs/demo/bak.cast b/docs/demo/bak.cast new file mode 100644 index 0000000..a618889 --- /dev/null +++ b/docs/demo/bak.cast @@ -0,0 +1,145 @@ +{"version": 2, "width": 99, "height": 38, "timestamp": 1634403111, "env": {"SHELL": "/usr/bin/fish", "TERM": "alacritty"}} +[1.07937, "o", "\u001b[H\u001b[2J\u001b[3J"] +[1.093649, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] +[2.172784, "o", "l"] +[2.239658, "o", "s"] +[2.510388, "o", "\u001b[0m\r\n"] +[2.515728, "o", "todo.txt\r\n"] +[2.526335, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] +[3.608887, "o", "c"] +[3.67595, "o", "a"] +[3.735261, "o", "t"] +[3.952963, "o", " "] +[4.013335, "o", "t"] +[4.080591, "o", "o"] +[4.147725, "o", "d"] +[4.214877, "o", "o"] +[4.431172, "o", "."] +[4.499585, "o", "t"] +[4.566297, "o", "x"] +[4.633565, "o", "t"] +[4.904214, "o", "\u001b[0m\r\n"] +[4.909233, "o", "- [X] Install bak\r\n- [X] Make my life easier\r\n"] +[5.912115, "o", "\r\n"] +[5.912392, "o", "\u001b[1;32mBackup todo.txt\r\n\u001b[0m"] +[5.921949, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] +[7.005859, "o", "b"] +[7.072185, "o", "a"] +[7.132188, "o", "k"] +[7.350442, "o", " "] +[7.418191, "o", "t"] +[7.484907, "o", "o"] +[7.552543, "o", "d"] +[7.620444, "o", "o"] +[7.838585, "o", "."] +[7.906243, "o", "t"] +[7.975194, "o", "x"] +[8.042191, "o", "t"] +[8.312665, "o", "\u001b[0m\r\n"] +[8.43127, "o", "\u001b[1;32mChange the file\r\n\u001b[0m"] +[8.435286, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] +[9.504625, "o", "v"] +[9.571941, "o", "i"] +[9.639224, "o", "m"] +[9.855579, "o", " "] +[9.922217, "o", "t"] +[9.986696, "o", "o"] +[10.054247, "o", "d"] +[10.121524, "o", "o"] +[10.338563, "o", "."] +[10.406069, "o", "t"] +[10.473536, "o", "x"] +[10.540237, "o", "t"] +[10.810864, "o", "\u001b[0m\r\n"] +[10.830563, "o", "\u001b[?1049h\u001b[22;0;0t\u001b[?1h\u001b=\u001b[H\u001b[2J\u001b[?12l\u001b[?25h\u001b[?1000l\u001b[?1002l\u001b[?1003l\u001b[?1006l\u001b[?1005l\u001b(B\u001b[m\u001b[?12l\u001b[?25h\u001b[?1006l\u001b[?1000l\u001b[?1002l\u001b[?1003l\u001b[?2004l\u001b[1;1H\u001b[1;38r\u001b[>c\u001b[>q\u001b[1;1H"] +[10.831459, "o", "\u001b[?25l\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\u001b[?12l\u001b[?25h\u001b[H"] +[10.832795, "o", "\u001b[?7727h"] +[10.836679, "o", "\u001b(B\u001b[m\u001b[?12l\u001b[?25h\u001b[?1006l\u001b[?1000l\u001b[?1002l\u001b[?1003l\u001b[?2004l\u001b[1;1H\u001b[1;38r\u001b[1;1H"] +[10.837018, "o", "\u001b[?25l\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\u001b[?12l\u001b[?25h\u001b[H"] +[10.882781, "o", "\u001b[?25l\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\u001b[?12l\u001b[?25h\u001b[H\u001b[?1006h\u001b[?1000h"] +[10.883554, "o", "\r\n\u001b[J\u001b[H\u001b[K\u001b[38d\"todo.txt\" 3L, 89B\u001b[?25l"] +[10.889917, "o", "\u001b[H- \u001b[33m[\u001b[39mX\u001b[33m]\u001b[39m Install bak\r\n- \u001b[33m[\u001b[39mX\u001b[33m]\u001b[39m Make my life easier\r\n- \u001b[33m[\u001b[39m \u001b[33m]\u001b[39m Take out trash\u001b[9C\u001b[34m# Freshly added\r\n\u001b[1m~ \u001b[5;1H~ \u001b[6;1H~ \u001b[7;1H~ \u001b[8;1H~ \u001b[9;1H~ \u001b[10;1H~ \u001b[11;1H~ \u001b[12;1H~ "] +[10.890071, "o", " \u001b[13;1H~ \u001b[14;1H~ \u001b[15;1H~ \u001b[16;1H~ \u001b[17;1H~ \u001b[18;1H~ \u001b[19;1H~ \u001b[20;1H~ \u001b[21;1H~ \u001b(B\u001b[m"] +[10.890448, "o", "\u001b[34m\u001b[1m \u001b[22;1H~ \u001b[23;1H~ \u001b[24;1H~ \u001b[25;1H~ \u001b[26;1H~ \u001b[27;1H~ \u001b[28;1H~ \u001b[29;1H~ \u001b[30;1H~ \u001b[31;1H~ "] +[10.890509, "o", " \u001b[32;1H~ \u001b[33;1H~ \u001b[34;1H~ \u001b[35;1H~ \u001b[36;1H~ \u001b[37;1H~ \u001b[38;82H\u001b(B\u001b[m1,1\u001b[11CAll\u001b[H\u001b[?12l\u001b[?25h"] +[11.827123, "o", "\u001b[?25l\u001b[?12l\u001b[?25h"] +[13.317374, "o", "\u001b[1;38r\u001b(B\u001b[m\u001b[?1l\u001b>\u001b[H\u001b[2J\u001b[?12l\u001b[?25h\u001b[?1000l\u001b[?1002l\u001b[?1003l\u001b[?1006l\u001b[?1005l\u001b[?7727l\u001b[?1004l\u001b[?1049l\u001b[23;0;0t"] +[13.3203, "o", "\u001b[1;32mLet's back up the changes\r\n\u001b[0m"] +[13.330588, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] +[14.417459, "o", "b"] +[14.484705, "o", "a"] +[14.551927, "o", "k"] +[14.769832, "o", " "] +[14.83777, "o", "t"] +[14.90424, "o", "o"] +[14.972481, "o", "d"] +[15.041023, "o", "o"] +[15.259225, "o", "."] +[15.326937, "o", "t"] +[15.394614, "o", "x"] +[15.46285, "o", "t"] +[15.734203, "o", "\u001b[0m\r\n"] +[15.856351, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] +[16.937275, "o", "b"] +[17.005424, "o", "a"] +[17.073867, "o", "k"] +[17.292185, "o", " "] +[17.360178, "o", "l"] +[17.427337, "o", "i"] +[17.494149, "o", "s"] +[17.563169, "o", "t"] +[17.780172, "o", " "] +[17.849405, "o", "t"] +[17.916138, "o", "o"] +[17.976808, "o", "d"] +[18.033486, "o", "o"] +[18.244426, "o", "."] +[18.305509, "o", "t"] +[18.372711, "o", "x"] +[18.440907, "o", "t"] +[18.71055, "o", "\u001b[0m\r\n"] +[18.823355, "o", "\u001b[3m .bakfiles of /tmp/tuterm/home1/todo.txt \u001b[0m\r\n┏━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━┓\r\n┃\u001b[1m \u001b[0m\u001b[1m \u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mOriginal File \u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mDate Created \u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mLast Modified \u001b[0m\u001b[1m \u001b[0m┃\r\n┠──────┼────────────────────────────┼─────────────────────┼─────────────────────┨\r\n┃ \u001b[1;31m-- \u001b[0m\u001b[1m1\u001b[0m │ \u001b[32m/tmp/tuterm/home1/todo.txt\u001b[0m │ \u001b[34m2021-10-16 18:51:59\u001b[0m │ \u001b[34m2021-10-16 18:51:59\u001b[0m ┃\r\n┠──────┼────────────────────────────┼─"] +[18.823757, "o", "────────────────────┼─────────────────────┨\r\n┃ \u001b[1;32m++ \u001b[0m\u001b[1m2\u001b[0m │ \u001b[32m/tmp/tuterm/home1/todo.txt\u001b[0m │ \u001b[34m2021-10-16 18:52:06\u001b[0m │ \u001b[34m2021-10-16 18:52:06\u001b[0m ┃\r\n┗━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┛\r\n \u001b[31m-- \u001b[0m\u001b[2;3moldest .bak \u001b[0m\u001b[32m++ \u001b[0m\u001b[2;3mnewest .bak \u001b[0m\u001b[33m** \u001b[0m\u001b[2;3mrestored\u001b[0m \r\n \u001b[2;3m (files may have been edited since restoration)\u001b[0m \r\n"] +[18.834403, "o", "\r\n"] +[19.836014, "o", "\u001b[1;32mRestore the file from entry #1 (the original)\r\n"] +[19.836151, "o", "\u001b[0m"] +[19.844732, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] +[20.927772, "o", "b"] +[20.995317, "o", "a"] +[21.052266, "o", "k"] +[21.27046, "o", " "] +[21.338377, "o", "d"] +[21.407088, "o", "o"] +[21.471395, "o", "w"] +[21.535087, "o", "n"] +[21.752847, "o", " "] +[21.820491, "o", "t"] +[21.887822, "o", "o"] +[21.958487, "o", "d"] +[22.014694, "o", "o"] +[22.232897, "o", "."] +[22.295839, "o", "t"] +[22.3656, "o", "x"] +[22.432501, "o", "t"] +[22.65126, "o", " "] +[22.719142, "o", "1"] +[22.989713, "o", "\u001b[0m\r\n"] +[22.992285, "o", "1 bakfiles discarded\r\n"] +[23.097644, "o", "Confirm: Restore /tmp/tuterm/home1/todo.txt from bakfile #1 and erase bakfiles ? [y/N]: "] +[23.110034, "o", "yes: standard output: Broken pipe\r\n"] +[23.110683, "o", "y\r\n\r\n"] +[23.114047, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] +[24.182614, "o", "c"] +[24.247636, "o", "a"] +[24.314625, "o", "t"] +[24.532471, "o", " "] +[24.592146, "o", "t"] +[24.659779, "o", "o"] +[24.727342, "o", "d"] +[24.79527, "o", "o"] +[25.013479, "o", "."] +[25.07945, "o", "t"] +[25.146624, "o", "x"] +[25.204063, "o", "t"] +[25.474428, "o", "\u001b[0m\r\n"] +[25.478481, "o", "- [X] Install bak\r\n- [X] Make my life easier\r\n"] diff --git a/docs/bak.tut b/docs/demo/bak.tut similarity index 94% rename from docs/bak.tut rename to docs/demo/bak.tut index 512559f..94dc9e6 100644 --- a/docs/bak.tut +++ b/docs/demo/bak.tut @@ -8,6 +8,9 @@ configure() { DELAY='0.05s' DELAY_SEP='0.2s' DELAY_PROMPT='1s' + TUTERM_NAME='bak-demo' + else + TUTERM_NAME='bak-tutorial' fi } @@ -71,7 +74,8 @@ run() { bak down todo.txt 1 else echo "1 bakfiles discarded" - { sleep 1 && yes; } | bak down todo.txt 1 + # { sleep 1 && yes; } | bak down todo.txt 1 + yes | bak down todo.txt 1 echo y fi echo diff --git a/docs/demo/bak_demo.svg b/docs/demo/bak_demo.svg new file mode 100644 index 0000000..8a7909c --- /dev/null +++ b/docs/demo/bak_demo.svg @@ -0,0 +1 @@ +bak.tut~$bak.tut~$lstodo.txtbak.tut~$cbak.tut~$cabak.tut~$catbak.tut~$cattbak.tut~$cattobak.tut~$cattodbak.tut~$cattodobak.tut~$cattodo.bak.tut~$cattodo.tbak.tut~$cattodo.txbak.tut~$cattodo.txt-[X]Installbak-[X]MakemylifeeasierBackuptodo.txtbak.tut~$bbak.tut~$babak.tut~$bakbak.tut~$baktbak.tut~$baktobak.tut~$baktodbak.tut~$baktodobak.tut~$baktodo.bak.tut~$baktodo.tbak.tut~$baktodo.txbak.tut~$baktodo.txtChangethefilebak.tut~$vimbak.tut~$vimtodo.txt"todo.txt"3L,89B-[X]Installbak-[X]Makemylifeeasier-[]Takeouttrash#Freshlyadded~Let'sbackupthechangesbak.tut~$baklistbak.tut~$baklisttodo.txt.bakfilesof/tmp/tuterm/home1/todo.txt┏━━━━━━┯━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━┓OriginalFileDateCreatedLastModified┠──────┼──────────────────┼──────────────────┼──────────────────┨--1/tmp/tuterm/hom…2021-10-162021-10-1614:37:5914:37:59++2/tmp/tuterm/hom…2021-10-162021-10-1614:38:0614:38:06┗━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┛--oldest.bak++newest.bak**restored(filesmayhavebeeneditedsincerestoration)Restorethefilefromentry#1(theoriginal)bak.tut~$bakdownbak.tut~$bakdowntodo.txtbak.tut~$bakdowntodo.txt11bakfilesdiscardedConfirm:Restore/tmp/tuterm/home1/todo.txtfrombakfile#1anderasebakfiles?[y/N]:yes:standardoutput:Brokenpipeybak.tut~$lbak.tut~$vbak.tut~$vibak.tut~$vimtbak.tut~$vimtobak.tut~$vimtodbak.tut~$vimtodobak.tut~$vimtodo.bak.tut~$vimtodo.tbak.tut~$vimtodo.tx"todo.txt"3L,89B1,1Allbak.tut~$baklbak.tut~$baklibak.tut~$baklisbak.tut~$baklisttbak.tut~$baklisttobak.tut~$baklisttodbak.tut~$baklisttodobak.tut~$baklisttodo.bak.tut~$baklisttodo.tbak.tut~$baklisttodo.tx┠──────┼──────────────────┼──────────────────┼────────bak.tut~$bakdbak.tut~$bakdobak.tut~$bakdowbak.tut~$bakdowntbak.tut~$bakdowntobak.tut~$bakdowntodbak.tut~$bakdowntodobak.tut~$bakdowntodo.bak.tut~$bakdowntodo.tbak.tut~$bakdowntodo.txrasebakfiles?[y/N]: \ No newline at end of file From c40df9c566983130e04d21d6bfe9386726d941a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 20:08:35 +0200 Subject: [PATCH 08/13] Remove bak_demo.svg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- docs/demo/.gitignore | 1 + docs/demo/bak_demo.svg | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 docs/demo/.gitignore delete mode 100644 docs/demo/bak_demo.svg diff --git a/docs/demo/.gitignore b/docs/demo/.gitignore new file mode 100644 index 0000000..6b6a201 --- /dev/null +++ b/docs/demo/.gitignore @@ -0,0 +1 @@ +bak_demo.svg diff --git a/docs/demo/bak_demo.svg b/docs/demo/bak_demo.svg deleted file mode 100644 index 8a7909c..0000000 --- a/docs/demo/bak_demo.svg +++ /dev/null @@ -1 +0,0 @@ -bak.tut~$bak.tut~$lstodo.txtbak.tut~$cbak.tut~$cabak.tut~$catbak.tut~$cattbak.tut~$cattobak.tut~$cattodbak.tut~$cattodobak.tut~$cattodo.bak.tut~$cattodo.tbak.tut~$cattodo.txbak.tut~$cattodo.txt-[X]Installbak-[X]MakemylifeeasierBackuptodo.txtbak.tut~$bbak.tut~$babak.tut~$bakbak.tut~$baktbak.tut~$baktobak.tut~$baktodbak.tut~$baktodobak.tut~$baktodo.bak.tut~$baktodo.tbak.tut~$baktodo.txbak.tut~$baktodo.txtChangethefilebak.tut~$vimbak.tut~$vimtodo.txt"todo.txt"3L,89B-[X]Installbak-[X]Makemylifeeasier-[]Takeouttrash#Freshlyadded~Let'sbackupthechangesbak.tut~$baklistbak.tut~$baklisttodo.txt.bakfilesof/tmp/tuterm/home1/todo.txt┏━━━━━━┯━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━┓OriginalFileDateCreatedLastModified┠──────┼──────────────────┼──────────────────┼──────────────────┨--1/tmp/tuterm/hom…2021-10-162021-10-1614:37:5914:37:59++2/tmp/tuterm/hom…2021-10-162021-10-1614:38:0614:38:06┗━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┛--oldest.bak++newest.bak**restored(filesmayhavebeeneditedsincerestoration)Restorethefilefromentry#1(theoriginal)bak.tut~$bakdownbak.tut~$bakdowntodo.txtbak.tut~$bakdowntodo.txt11bakfilesdiscardedConfirm:Restore/tmp/tuterm/home1/todo.txtfrombakfile#1anderasebakfiles?[y/N]:yes:standardoutput:Brokenpipeybak.tut~$lbak.tut~$vbak.tut~$vibak.tut~$vimtbak.tut~$vimtobak.tut~$vimtodbak.tut~$vimtodobak.tut~$vimtodo.bak.tut~$vimtodo.tbak.tut~$vimtodo.tx"todo.txt"3L,89B1,1Allbak.tut~$baklbak.tut~$baklibak.tut~$baklisbak.tut~$baklisttbak.tut~$baklisttobak.tut~$baklisttodbak.tut~$baklisttodobak.tut~$baklisttodo.bak.tut~$baklisttodo.tbak.tut~$baklisttodo.tx┠──────┼──────────────────┼──────────────────┼────────bak.tut~$bakdbak.tut~$bakdobak.tut~$bakdowbak.tut~$bakdowntbak.tut~$bakdowntobak.tut~$bakdowntodbak.tut~$bakdowntodobak.tut~$bakdowntodo.bak.tut~$bakdowntodo.tbak.tut~$bakdowntodo.txrasebakfiles?[y/N]: \ No newline at end of file From 66c9f3c8219406079781f6851aac7367221cd1a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 20:24:49 +0200 Subject: [PATCH 09/13] Edit asciinema_upload_and_create_svg.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- docs/demo/README.md | 7 +++++ docs/demo/asciinema_upload_and_create_svg.sh | 28 +++++++++++++++----- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/docs/demo/README.md b/docs/demo/README.md index ba8d35a..2cb5cad 100644 --- a/docs/demo/README.md +++ b/docs/demo/README.md @@ -1,3 +1,10 @@ +## Dependencies + +- [asciinema](https://github.com/asciinema/asciinema) +- [tuterm](https://github.com/veracioux/tuterm) + +## Running + To run a non-interactive demo: ```shell diff --git a/docs/demo/asciinema_upload_and_create_svg.sh b/docs/demo/asciinema_upload_and_create_svg.sh index 1b36b59..1c98105 100644 --- a/docs/demo/asciinema_upload_and_create_svg.sh +++ b/docs/demo/asciinema_upload_and_create_svg.sh @@ -1,5 +1,12 @@ #!/usr/bin/env sh +# NOTE: Change this to suit your needs + +TERM_WIDTH=110 +TERM_HEIGHT=30 +RECORDED_COMMAND="tuterm bak.tut --mode demo" +alias copy='xsel -b' + # Dependencies: # - asciinema (https://github.com/asciinema/asciinema) # - svg-term (https://github.com/marionebl/svg-term-cli) @@ -8,17 +15,26 @@ # Since you are here, please also look at tuterm: # https://github.com/veracioux/tuterm -RECORDED_COMMAND="tuterm bak.tut --mode demo" -alias copy='xsel -b' - rm -f /tmp/bakfile_bak.cast + # Record the command asciinema rec -c "$RECORDED_COMMAND" /tmp/bakfile_bak.cast -cat /tmp/bakfile_bak.cast | svg-term --out bak_demo.svg + +# Change terminal width and height +# NOTE: for some reason the yes command prints Broken pipe; this is a workaround +sed -e "1 s/\(\"width\": \)[0-9]\+/\1$TERM_WIDTH/" \ + -e "1 s/\(\"height\": \)[0-9]\+/\1$TERM_HEIGHT/" \ + -e '/Broken pipe/d' \ + -i /tmp/bakfile_bak.cast + # Upload to asciinema.org output="$(asciinema upload /tmp/bakfile_bak.cast)" - echo "$output" -# Copy to clipboard +# Copy URL to clipboard echo "$output" | grep 'https:' | sed 's/^\s*//' | copy + +# Create local SVG animation +cat /tmp/bakfile_bak.cast | svg-term --out bak_demo.svg + +echo "SVG animation saved as 'bak_demo.svg'" From a814a393b51a2ea867b9b7a463f767e2eee6c64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 20:41:38 +0200 Subject: [PATCH 10/13] Change terminal size using stty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- docs/demo/README.md | 9 ++++++--- docs/demo/asciinema_upload_and_create_svg.sh | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/demo/README.md b/docs/demo/README.md index 2cb5cad..be3ed8c 100644 --- a/docs/demo/README.md +++ b/docs/demo/README.md @@ -24,7 +24,10 @@ To upload the demo to asciinema and create an SVG animated image: ``` This will copy the asciinema URL to your clipboard and print it to your -terminal. The SVG animation is created as `./bak_demo.svg`. +terminal. The SVG animation will be created as `./bak_demo.svg`. -You should preview the demo first to verify it, so as to avoid uploading content -unnecessarily. +**NOTE:** +- You should preview the demo first to verify it, so as to avoid uploading + content unnecessarily. +- You should run the upload script in a new terminal so it doesn't mess up your + terminal size diff --git a/docs/demo/asciinema_upload_and_create_svg.sh b/docs/demo/asciinema_upload_and_create_svg.sh index 1c98105..5d273d4 100644 --- a/docs/demo/asciinema_upload_and_create_svg.sh +++ b/docs/demo/asciinema_upload_and_create_svg.sh @@ -2,8 +2,8 @@ # NOTE: Change this to suit your needs -TERM_WIDTH=110 -TERM_HEIGHT=30 +TERM_WIDTH=90 +TERM_HEIGHT=25 RECORDED_COMMAND="tuterm bak.tut --mode demo" alias copy='xsel -b' @@ -17,6 +17,7 @@ alias copy='xsel -b' rm -f /tmp/bakfile_bak.cast +stty cols "$TERM_WIDTH" rows "$TERM_HEIGHT" # Record the command asciinema rec -c "$RECORDED_COMMAND" /tmp/bakfile_bak.cast From 3b4d0e2c4de92716ac69ef94fd1ba23202c2fd54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 20:55:02 +0200 Subject: [PATCH 11/13] Remove file bak.cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- docs/demo/.gitignore | 1 + docs/demo/bak.cast | 145 ------------------------------------------- 2 files changed, 1 insertion(+), 145 deletions(-) delete mode 100644 docs/demo/bak.cast diff --git a/docs/demo/.gitignore b/docs/demo/.gitignore index 6b6a201..74d826e 100644 --- a/docs/demo/.gitignore +++ b/docs/demo/.gitignore @@ -1 +1,2 @@ bak_demo.svg +bak_cast.cast diff --git a/docs/demo/bak.cast b/docs/demo/bak.cast deleted file mode 100644 index a618889..0000000 --- a/docs/demo/bak.cast +++ /dev/null @@ -1,145 +0,0 @@ -{"version": 2, "width": 99, "height": 38, "timestamp": 1634403111, "env": {"SHELL": "/usr/bin/fish", "TERM": "alacritty"}} -[1.07937, "o", "\u001b[H\u001b[2J\u001b[3J"] -[1.093649, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] -[2.172784, "o", "l"] -[2.239658, "o", "s"] -[2.510388, "o", "\u001b[0m\r\n"] -[2.515728, "o", "todo.txt\r\n"] -[2.526335, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] -[3.608887, "o", "c"] -[3.67595, "o", "a"] -[3.735261, "o", "t"] -[3.952963, "o", " "] -[4.013335, "o", "t"] -[4.080591, "o", "o"] -[4.147725, "o", "d"] -[4.214877, "o", "o"] -[4.431172, "o", "."] -[4.499585, "o", "t"] -[4.566297, "o", "x"] -[4.633565, "o", "t"] -[4.904214, "o", "\u001b[0m\r\n"] -[4.909233, "o", "- [X] Install bak\r\n- [X] Make my life easier\r\n"] -[5.912115, "o", "\r\n"] -[5.912392, "o", "\u001b[1;32mBackup todo.txt\r\n\u001b[0m"] -[5.921949, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] -[7.005859, "o", "b"] -[7.072185, "o", "a"] -[7.132188, "o", "k"] -[7.350442, "o", " "] -[7.418191, "o", "t"] -[7.484907, "o", "o"] -[7.552543, "o", "d"] -[7.620444, "o", "o"] -[7.838585, "o", "."] -[7.906243, "o", "t"] -[7.975194, "o", "x"] -[8.042191, "o", "t"] -[8.312665, "o", "\u001b[0m\r\n"] -[8.43127, "o", "\u001b[1;32mChange the file\r\n\u001b[0m"] -[8.435286, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] -[9.504625, "o", "v"] -[9.571941, "o", "i"] -[9.639224, "o", "m"] -[9.855579, "o", " "] -[9.922217, "o", "t"] -[9.986696, "o", "o"] -[10.054247, "o", "d"] -[10.121524, "o", "o"] -[10.338563, "o", "."] -[10.406069, "o", "t"] -[10.473536, "o", "x"] -[10.540237, "o", "t"] -[10.810864, "o", "\u001b[0m\r\n"] -[10.830563, "o", "\u001b[?1049h\u001b[22;0;0t\u001b[?1h\u001b=\u001b[H\u001b[2J\u001b[?12l\u001b[?25h\u001b[?1000l\u001b[?1002l\u001b[?1003l\u001b[?1006l\u001b[?1005l\u001b(B\u001b[m\u001b[?12l\u001b[?25h\u001b[?1006l\u001b[?1000l\u001b[?1002l\u001b[?1003l\u001b[?2004l\u001b[1;1H\u001b[1;38r\u001b[>c\u001b[>q\u001b[1;1H"] -[10.831459, "o", "\u001b[?25l\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\u001b[?12l\u001b[?25h\u001b[H"] -[10.832795, "o", "\u001b[?7727h"] -[10.836679, "o", "\u001b(B\u001b[m\u001b[?12l\u001b[?25h\u001b[?1006l\u001b[?1000l\u001b[?1002l\u001b[?1003l\u001b[?2004l\u001b[1;1H\u001b[1;38r\u001b[1;1H"] -[10.837018, "o", "\u001b[?25l\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\u001b[?12l\u001b[?25h\u001b[H"] -[10.882781, "o", "\u001b[?25l\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\r\n\u001b[K\u001b[?12l\u001b[?25h\u001b[H\u001b[?1006h\u001b[?1000h"] -[10.883554, "o", "\r\n\u001b[J\u001b[H\u001b[K\u001b[38d\"todo.txt\" 3L, 89B\u001b[?25l"] -[10.889917, "o", "\u001b[H- \u001b[33m[\u001b[39mX\u001b[33m]\u001b[39m Install bak\r\n- \u001b[33m[\u001b[39mX\u001b[33m]\u001b[39m Make my life easier\r\n- \u001b[33m[\u001b[39m \u001b[33m]\u001b[39m Take out trash\u001b[9C\u001b[34m# Freshly added\r\n\u001b[1m~ \u001b[5;1H~ \u001b[6;1H~ \u001b[7;1H~ \u001b[8;1H~ \u001b[9;1H~ \u001b[10;1H~ \u001b[11;1H~ \u001b[12;1H~ "] -[10.890071, "o", " \u001b[13;1H~ \u001b[14;1H~ \u001b[15;1H~ \u001b[16;1H~ \u001b[17;1H~ \u001b[18;1H~ \u001b[19;1H~ \u001b[20;1H~ \u001b[21;1H~ \u001b(B\u001b[m"] -[10.890448, "o", "\u001b[34m\u001b[1m \u001b[22;1H~ \u001b[23;1H~ \u001b[24;1H~ \u001b[25;1H~ \u001b[26;1H~ \u001b[27;1H~ \u001b[28;1H~ \u001b[29;1H~ \u001b[30;1H~ \u001b[31;1H~ "] -[10.890509, "o", " \u001b[32;1H~ \u001b[33;1H~ \u001b[34;1H~ \u001b[35;1H~ \u001b[36;1H~ \u001b[37;1H~ \u001b[38;82H\u001b(B\u001b[m1,1\u001b[11CAll\u001b[H\u001b[?12l\u001b[?25h"] -[11.827123, "o", "\u001b[?25l\u001b[?12l\u001b[?25h"] -[13.317374, "o", "\u001b[1;38r\u001b(B\u001b[m\u001b[?1l\u001b>\u001b[H\u001b[2J\u001b[?12l\u001b[?25h\u001b[?1000l\u001b[?1002l\u001b[?1003l\u001b[?1006l\u001b[?1005l\u001b[?7727l\u001b[?1004l\u001b[?1049l\u001b[23;0;0t"] -[13.3203, "o", "\u001b[1;32mLet's back up the changes\r\n\u001b[0m"] -[13.330588, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] -[14.417459, "o", "b"] -[14.484705, "o", "a"] -[14.551927, "o", "k"] -[14.769832, "o", " "] -[14.83777, "o", "t"] -[14.90424, "o", "o"] -[14.972481, "o", "d"] -[15.041023, "o", "o"] -[15.259225, "o", "."] -[15.326937, "o", "t"] -[15.394614, "o", "x"] -[15.46285, "o", "t"] -[15.734203, "o", "\u001b[0m\r\n"] -[15.856351, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] -[16.937275, "o", "b"] -[17.005424, "o", "a"] -[17.073867, "o", "k"] -[17.292185, "o", " "] -[17.360178, "o", "l"] -[17.427337, "o", "i"] -[17.494149, "o", "s"] -[17.563169, "o", "t"] -[17.780172, "o", " "] -[17.849405, "o", "t"] -[17.916138, "o", "o"] -[17.976808, "o", "d"] -[18.033486, "o", "o"] -[18.244426, "o", "."] -[18.305509, "o", "t"] -[18.372711, "o", "x"] -[18.440907, "o", "t"] -[18.71055, "o", "\u001b[0m\r\n"] -[18.823355, "o", "\u001b[3m .bakfiles of /tmp/tuterm/home1/todo.txt \u001b[0m\r\n┏━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━┓\r\n┃\u001b[1m \u001b[0m\u001b[1m \u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mOriginal File \u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mDate Created \u001b[0m\u001b[1m \u001b[0m│\u001b[1m \u001b[0m\u001b[1mLast Modified \u001b[0m\u001b[1m \u001b[0m┃\r\n┠──────┼────────────────────────────┼─────────────────────┼─────────────────────┨\r\n┃ \u001b[1;31m-- \u001b[0m\u001b[1m1\u001b[0m │ \u001b[32m/tmp/tuterm/home1/todo.txt\u001b[0m │ \u001b[34m2021-10-16 18:51:59\u001b[0m │ \u001b[34m2021-10-16 18:51:59\u001b[0m ┃\r\n┠──────┼────────────────────────────┼─"] -[18.823757, "o", "────────────────────┼─────────────────────┨\r\n┃ \u001b[1;32m++ \u001b[0m\u001b[1m2\u001b[0m │ \u001b[32m/tmp/tuterm/home1/todo.txt\u001b[0m │ \u001b[34m2021-10-16 18:52:06\u001b[0m │ \u001b[34m2021-10-16 18:52:06\u001b[0m ┃\r\n┗━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┛\r\n \u001b[31m-- \u001b[0m\u001b[2;3moldest .bak \u001b[0m\u001b[32m++ \u001b[0m\u001b[2;3mnewest .bak \u001b[0m\u001b[33m** \u001b[0m\u001b[2;3mrestored\u001b[0m \r\n \u001b[2;3m (files may have been edited since restoration)\u001b[0m \r\n"] -[18.834403, "o", "\r\n"] -[19.836014, "o", "\u001b[1;32mRestore the file from entry #1 (the original)\r\n"] -[19.836151, "o", "\u001b[0m"] -[19.844732, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] -[20.927772, "o", "b"] -[20.995317, "o", "a"] -[21.052266, "o", "k"] -[21.27046, "o", " "] -[21.338377, "o", "d"] -[21.407088, "o", "o"] -[21.471395, "o", "w"] -[21.535087, "o", "n"] -[21.752847, "o", " "] -[21.820491, "o", "t"] -[21.887822, "o", "o"] -[21.958487, "o", "d"] -[22.014694, "o", "o"] -[22.232897, "o", "."] -[22.295839, "o", "t"] -[22.3656, "o", "x"] -[22.432501, "o", "t"] -[22.65126, "o", " "] -[22.719142, "o", "1"] -[22.989713, "o", "\u001b[0m\r\n"] -[22.992285, "o", "1 bakfiles discarded\r\n"] -[23.097644, "o", "Confirm: Restore /tmp/tuterm/home1/todo.txt from bakfile #1 and erase bakfiles ? [y/N]: "] -[23.110034, "o", "yes: standard output: Broken pipe\r\n"] -[23.110683, "o", "y\r\n\r\n"] -[23.114047, "o", "\u001b[1;94mbak-demo \u001b[1;35m~\u001b[0;33m $\u001b[0m "] -[24.182614, "o", "c"] -[24.247636, "o", "a"] -[24.314625, "o", "t"] -[24.532471, "o", " "] -[24.592146, "o", "t"] -[24.659779, "o", "o"] -[24.727342, "o", "d"] -[24.79527, "o", "o"] -[25.013479, "o", "."] -[25.07945, "o", "t"] -[25.146624, "o", "x"] -[25.204063, "o", "t"] -[25.474428, "o", "\u001b[0m\r\n"] -[25.478481, "o", "- [X] Install bak\r\n- [X] Make my life easier\r\n"] From a00a2fa96d95aeb3de51b5a6f007ada2a82beb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 21:42:43 +0200 Subject: [PATCH 12/13] README proof of concept MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ad09cde..c8558e4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # bak +[![https://asciinema.org/a/442668](https://gist.github.com/veracioux/5281aa92b29e89c0da0086207640dfd2/raw/1a35f46b3b1ae00baed35911789faedb6fe8519f/bak_demo.svg)]() + **bak** is a command-line utility for creating and restoring backup copies of single files - `.bak` files - without clutter. - [Description and Usage](#description-and-usage) From 36712ca46e2e7ae7b73b24f6ff48ce5d77c91cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Sat, 16 Oct 2021 21:47:09 +0200 Subject: [PATCH 13/13] Fix link in README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c8558e4..abb062c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # bak -[![https://asciinema.org/a/442668](https://gist.github.com/veracioux/5281aa92b29e89c0da0086207640dfd2/raw/1a35f46b3b1ae00baed35911789faedb6fe8519f/bak_demo.svg)]() +[![](https://gist.github.com/veracioux/5281aa92b29e89c0da0086207640dfd2/raw/1a35f46b3b1ae00baed35911789faedb6fe8519f/bak_demo.svg)](https://asciinema.org/a/442668) **bak** is a command-line utility for creating and restoring backup copies of single files - `.bak` files - without clutter.