From 96fd444a48ebe86eb92bb6095cdf65b388f7759f Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Fri, 8 Mar 2024 17:49:22 +0100 Subject: [PATCH] Up. --- .../run_once_after_50-finalize-ranger.sh.tmpl | 36 +++++++++++++++++++ ... run_once_after_51-finalize-latex.sh.tmpl} | 4 +-- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 home/.chezmoiscripts/run_once_after_50-finalize-ranger.sh.tmpl rename home/.chezmoiscripts/{run_once_after_50-finalize-latex.sh.tmpl => run_once_after_51-finalize-latex.sh.tmpl} (81%) diff --git a/home/.chezmoiscripts/run_once_after_50-finalize-ranger.sh.tmpl b/home/.chezmoiscripts/run_once_after_50-finalize-ranger.sh.tmpl new file mode 100644 index 0000000..c411504 --- /dev/null +++ b/home/.chezmoiscripts/run_once_after_50-finalize-ranger.sh.tmpl @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# Logging function +log() { + printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1" +} + +inf() { + printf "$(tput setaf 2)╚═══ᐳ $(tput sgr 0 1)$(tput setaf 2)%s$(tput sgr0)\n" "$1" +} + + +# Environment variables +COMMAND_FILE=${HOME}/.config/ranger/commands.py + + + +log "Begin ranger finalization" + +case $(grep -Fx "from plugins.ranger_udisk_menu.mounter import mount" "${COMMAND_FILE}" ) + 0) + # found, do nothing + inf "Modification not needed." + ;; + 1) + # not found, add it + sed -i '10 i from plugins.ranger_udisk_menu.mounter import mount' ${COMMAND_FILE} + inf "Add line for mount plugin." + ;; + *) + # an error occurred + inf "An error occured." + ;; + +log "Finish ranger finalization" + diff --git a/home/.chezmoiscripts/run_once_after_50-finalize-latex.sh.tmpl b/home/.chezmoiscripts/run_once_after_51-finalize-latex.sh.tmpl similarity index 81% rename from home/.chezmoiscripts/run_once_after_50-finalize-latex.sh.tmpl rename to home/.chezmoiscripts/run_once_after_51-finalize-latex.sh.tmpl index b2baeb5..f8311a6 100644 --- a/home/.chezmoiscripts/run_once_after_50-finalize-latex.sh.tmpl +++ b/home/.chezmoiscripts/run_once_after_51-finalize-latex.sh.tmpl @@ -17,10 +17,10 @@ TEXMF=texmf/tex/latex {{- if (ne .latex false) -}} -log "Begin LaTeX initialization" +log "Begin LaTeX repo initialization" texhash "${HOME}/${TEXMF}" -log "Finish LaTeX initialization" +log "Finish LaTeX repo initialization" {{- end }}