mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
Cleaning up some scripts and moving to autoload functions
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
session="dots"
|
||||
|
||||
tmux switch-client -t "$session" || \
|
||||
tmux attach -t "$session" || \
|
||||
tmux new-session -c "$DOTFILES" -s "$session"
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# makes files executable
|
||||
test -f "$1" && chmod +x "$1"
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
for file in "$SCREENSHOTS"/*; do
|
||||
rm "$file"
|
||||
done
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/zsh
|
||||
|
||||
# adapted from...
|
||||
# https://github.com/rwxrob/dot/blob/main/scripts/cmt
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/zsh
|
||||
|
||||
declare hide
|
||||
declare show
|
||||
|
||||
zparseopts -D -E -K -- \
|
||||
{h,-hide}=hide \
|
||||
{s,-show}=show
|
||||
|
||||
if [ -n "$hide" ]; then
|
||||
defaults write com.apple.finder CreateDesktop false && killall Finder
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -n "$show" ]; then
|
||||
defaults write com.apple.finder CreateDesktop true && killall Finder
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Please pass in --hide | --show"
|
||||
exit 1
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Creates an encrypted disk image from a folder
|
||||
|
||||
set -e
|
||||
|
||||
from="$1"
|
||||
to="$2"
|
||||
|
||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
||||
echo "Usage: dmg <fromdir> <todir>"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
name="$(isosec).dmg"
|
||||
hdiutil create -encryption AES-256 -srcfolder "$from" "$to/$name"
|
||||
@@ -1,9 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
date -u '+%Y%m%d%H%M%S'
|
||||
|
||||
isosec() {
|
||||
echo "$(date -u '+%Y%m%d%H%M%S')"
|
||||
}
|
||||
|
||||
isosec
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Lists files and directories, including hidden files.
|
||||
|
||||
ls -lah --color "$@"
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Creates a directory then `cd`'s into the directory
|
||||
|
||||
set -e
|
||||
|
||||
dir="$1"
|
||||
|
||||
test -n "${dir}" || echo "usage: mkcd <dir>" && exit 1
|
||||
|
||||
mkdir "${dir}"
|
||||
cd "${dir}"
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Creates a new `zet` inside the House Call Pro `Zettlekasten`
|
||||
# Creates a new `zet` inside the NCI Summit `Zettlekasten`
|
||||
|
||||
_main() {
|
||||
(ZETDIR="$HOME/Documents/NCISummit" eval zet "$@")
|
||||
ZETDIR="$HOME/Documents/NCISummit" eval zet "$@"
|
||||
}
|
||||
|
||||
_main "$@"
|
||||
|
||||
@@ -16,7 +16,7 @@ shell="${2:-sh}"
|
||||
|
||||
if [ -e "${path}" ]; then
|
||||
echo "Already exists try:"
|
||||
echo "vi ${path}"
|
||||
echo "$EDITOR $path"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
#!/bin/sh
|
||||
#!/bin/zsh
|
||||
|
||||
# Change / select an nvim configuration.
|
||||
#
|
||||
# The configuration's need to be in the ~/.config folder
|
||||
# to work properly.
|
||||
#
|
||||
main() {
|
||||
items=("default" "m-housh" "kickstart" "lazy")
|
||||
config=$(printf "%s\n" "${items[@]}" | fzf --prompt=" Neovim Config ➣ " --height=50% --layout=reverse --border --exit-0)
|
||||
if [[ -z $config ]]; then
|
||||
config=$(printf "%s\n" "${items[@]}" \
|
||||
| fzf --prompt=" Neovim Config ➣ " --height=50% --layout=reverse --border --exit-0
|
||||
)
|
||||
if [ -z "$config" ]; then
|
||||
echo "Nothing selected"
|
||||
return 0
|
||||
elif [[ $config == "default" ]]; then
|
||||
elif [ $config == "default" ]; then
|
||||
config=""
|
||||
fi
|
||||
unset VIMINIT && unset MYVIMRC && export NVIM_APPNAME=$config && nvim $@
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Move into the proposals directory
|
||||
cd "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Work/Proposals"
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Creates a new `zet` inside the House Call Pro `Zettlekasten`
|
||||
# Creates a new `zet` inside the private `Zettlekasten`
|
||||
|
||||
_main() {
|
||||
(ZETDIR="$GHREPOS/private-zets" eval zet "$@")
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# opens a shell command in $EDITOR
|
||||
cmd="$(command -v $1)"
|
||||
test -n "$cmd" && "$EDITOR" "$cmd"
|
||||
Reference in New Issue
Block a user