Added some scripts

This commit is contained in:
2021-12-28 15:20:30 -05:00
parent 226e07f501
commit f9892ee952
5 changed files with 48 additions and 0 deletions

16
scripts/.local/scripts/figl Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
# Create a new figlet (ascii art) from the input.
figl() {
font=${FIGL_FONT:-puffy}
declare -a buf
while IFS= read -r line; do
buf+=("$line")
done
for line in "${buf[@]}"; do
figlet -f "$font" -c "${line}" | head -6
done
}
figl "$*"

24
scripts/.local/scripts/newx Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
# Creates a new executable file in the $SCRIPTS directory.
# check if the scripts path / environment variable is set
test ! -n "${SCRIPTS}" && echo "SCRIPTS not set" && exit 1;
# fallback to check if the name arg ${1} exists, if not show usage text.
test ! -n "${1}" && echo "usage: newscript <name>" && exit 1;
path="${SCRIPTS}/${1}"
if [ -e "${path}" ]; then
read -p "${1} already exists. Edit? " yes
case "${yes}" in
y|yes|yep|yeppers|yeah|ok|okay) exec vim "${path}"
esac
exit 0
fi
printf "#!/bin/sh\n\n" > "${path}"
chmod +x "${path}"
exec vim +2 "${path}"

2
scripts/.local/scripts/path Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/zsh
echo -e ${PATH//:/\\n}