mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
Added some scripts
This commit is contained in:
16
scripts/.local/scripts/figl
Executable file
16
scripts/.local/scripts/figl
Executable 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
24
scripts/.local/scripts/newx
Executable 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
2
scripts/.local/scripts/path
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/zsh
|
||||
echo -e ${PATH//:/\\n}
|
||||
Reference in New Issue
Block a user