mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-13 22:02: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}
|
||||
@@ -63,6 +63,8 @@ fpath_prepend() {
|
||||
|
||||
# last arg will be first in path
|
||||
path_prepend \
|
||||
"/opt/homebrew/bin" \
|
||||
"/opt/homebrew/sbin" \
|
||||
"$(brew --prefix)/sbin" \
|
||||
"$(brew --prefix)/bin" \
|
||||
"$HOME/.local/bin" \
|
||||
|
||||
@@ -39,6 +39,7 @@ alias l() { ls -lah "$@" }
|
||||
|
||||
# editor
|
||||
alias vim() { nvim "$@" }
|
||||
alias vi() { nvim "$@" }
|
||||
|
||||
# git
|
||||
alias g() { git "$@" }
|
||||
@@ -58,6 +59,9 @@ if [ $(hostname -s) = "Michaels-Mac-mini" ]; then
|
||||
alias projects() { cd "/Volumes/M1 Mac-Mini External Drive/Projects" }
|
||||
fi
|
||||
|
||||
# change file to be executable
|
||||
alias chmox() { chmod +x "$@" }
|
||||
|
||||
# tmux
|
||||
#alias ta() { tmux -f ~/.config/tmux/tmux.config attach "$@" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user