From bd9393d7596915f3672ce83744d874bc85a13782 Mon Sep 17 00:00:00 2001 From: PatentLobster <37775846+PatentLobster@users.noreply.github.com> Date: Sun, 24 Sep 2023 18:16:30 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/vhs/tmux-vhs.sh | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/scripts/vhs/tmux-vhs.sh b/scripts/vhs/tmux-vhs.sh index 1c8049e..28decc2 100755 --- a/scripts/vhs/tmux-vhs.sh +++ b/scripts/vhs/tmux-vhs.sh @@ -1,19 +1,35 @@ #!/bin/bash -x # -tmux set-option -p remain-on-exit -sudo npm install -g terminalizer -sudo apt update -sudo apt install libnss3 lsb-release xdg-utils wget ffmpeg bc -#sudo apt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget ffmpeg bc + x="${X:-180}" y="${Y:-30}" export IFS=$'\n' session_name="my_session" -base_dir="$(dirname "$(chezmoi source-path)")" +base_dir="$(dirname "$(chez source-path)")" terminalizer_config="${base_dir}/scripts/vhs/config.yml" -terminalizer record -c $terminalizer_config "${base_dir}/demo" + + + +chez () { +if command -v chezmoi &> /dev/null; then + chezmoi $@ +else + if [ -f "$HOME/bin/chezmoi" ]; then + $HOME/bin/chezmoi $@ + fi + if [ -f "$HOME/.local/bin/chezmoi" ]; then + $HOME/.local/bin/chezmoi $@ + fi +fi +} + +sudo npm install -g terminalizer +sudo apt update +sudo apt install libnss3 lsb-release xdg-utils wget ffmpeg bc +sudo apt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget ffmpeg bc +#terminalizer record -c $terminalizer_config "${base_dir}/demo" function record() { - tmux send-keys -t "$session_name" "terminalizer record -c $terminalizer_config demo" + tmux send-keys -t "$session_name" "terminalizer record -c $terminalizer_config \"${base_dir}/demo\"" tmux send-keys -t "$session_name" C-m sleep 1 } @@ -58,8 +74,6 @@ function emulate_human_typing() { tmux send-keys -t "$session_name" C-m } - - function emulate_typing() { local text_to_type="$1" # Text to type in the session @@ -67,10 +81,7 @@ function emulate_typing() { tmux send-keys -t "$session_name" "$text_to_type" C-m } RUNNER_TRACKING_ID="" && tmux new -s "$session_name" -d -x $x -y $y "zsh" -#exec tmux new -s "$session_name" -x $x -y $y "zsh" -d tmux ls - - #emulate_human_typing "$(cat input.sh)" record emulate_human_typing "echo 'Hello, world!'"