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