From c754746b9f728557c248e370abc286035a9ce327 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Tue, 25 Jun 2024 01:24:44 +0300 Subject: [PATCH] chore(scripts): extract oh-my-posh screenshotter --- scripts/create-omp-screenshot.sh | 11 +++++++++++ scripts/install-ohmyposh.sh | 7 ------- scripts/shared.sh | 3 +++ 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100755 scripts/create-omp-screenshot.sh diff --git a/scripts/create-omp-screenshot.sh b/scripts/create-omp-screenshot.sh new file mode 100755 index 0000000..93af0fb --- /dev/null +++ b/scripts/create-omp-screenshot.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# +# shellcheck source=shared.sh +source "$HOME/.dotfiles/scripts/shared.sh" +set -e + +cd "$DOTFILES" || exit +oh-my-posh config export image \ + --config "$OHMYPOSH_CFG" \ + --output "$HOME/.dotfiles/.github/screenshots/oh-my-posh.png" \ + --author "Ismo Vuorinen" diff --git a/scripts/install-ohmyposh.sh b/scripts/install-ohmyposh.sh index f0d50ae..b2a37ed 100755 --- a/scripts/install-ohmyposh.sh +++ b/scripts/install-ohmyposh.sh @@ -7,12 +7,5 @@ source "$HOME/.dotfiles/scripts/shared.sh" curl -s https://ohmyposh.dev/install.sh | bash -s -- -d ~/.local/bin -OHMYPOSH_CFG="$HOME/.dotfiles/config/omp/own.toml" - eval "$(oh-my-posh init zsh --config $OHMYPOSH_CFG)" -#cd ~/.dotfiles || exit -#oh-my-posh config export image \ -# --config "$OHMYPOSH_CFG" \ -# --output "~/.dotfiles/.github/screenshots/oh-my-posh.png" \ -# --author "Ismo Vuorinen" diff --git a/scripts/shared.sh b/scripts/shared.sh index 28716e7..30babf9 100755 --- a/scripts/shared.sh +++ b/scripts/shared.sh @@ -27,6 +27,9 @@ export XDG_BIN_HOME="$HOME/.local/bin" export XDG_CACHE_HOME="$HOME/.cache" export XDG_RUNTIME_DIR="$HOME/.local/run" +# Other variables +export OHMYPOSH_CFG="$HOME/.dotfiles/config/omp/own.toml" + # Remove directory from the PATH variable # usage: path_remove ~/.local/bin function path_remove