Added more environment variables and dmg script

This commit is contained in:
2021-12-30 10:40:47 -05:00
parent 0623aad631
commit 6404ce4bb8
3 changed files with 32 additions and 5 deletions

1
.gitignore vendored
View File

@@ -10,3 +10,4 @@ zsh/.config/zsh/history
**/.zsh_sessions
**/completions/*
**/.netrwhist
**/.zshrc-local

15
scripts/.local/scripts/dmg Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
# Creates an encrypted disk image from a folder
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"

View File

@@ -1,10 +1,20 @@
#!/usr/bin/env zsh
#------------------------------ utilites ------------------------------
_source_if() { [[ -r "$1" ]] && source "$1" }
#------------------------------ exports ------------------------------
export ZDOTDIR="$HOME/.config/zsh"
export SHELL="$(which zsh)"
export GITUSER="m-housh"
export BUCKET="/Volumes/Bucket"
export ARCHIVE="/Volumes/Archive"
export REPOS="$BUCKET/Repos"
export GHREPOS="$REPOS/github.com/$GITUSER"
export LOCAL_REPOS="$$REPOS/local"
export DOCUMENTS="$HOME/Documents"
export DOWNLOADS="$HOME/Downloads"
export PDFS="$HOME/Library/Mobile Documents/com~apple~Preview/Documents"
export DOTFILES="$HOME/.dotfiles"
export DESKTOP="$HOME/Desktop"
export SCRIPTS="$HOME/.local/scripts"
@@ -12,7 +22,6 @@ export TERM=xterm-256color
export EDITOR=vi
export VISUAL=vi
export EDITOR_PREFIX=vi
export GITUSER="m-housh"
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
autoload -U up-line-or-beginning-search
@@ -24,7 +33,7 @@ zle -N down-line-or-beginning-search
autoload -Uz colors && colors
# Load Useful Functions
source "$ZDOTDIR/zsh-functions"
_source_if "$ZDOTDIR/zsh-functions"
#------------------------------ path ------------------------------
@@ -65,7 +74,7 @@ fpath_prepend() {
# last arg will be first in path
path_prepend \
"/usr/local/sbin" \
"usr/local/bin" \
"/usr/local/bin" \
"/opt/homebrew/bin" \
"/opt/homebrew/sbin" \
"$HOME/.local/bin" \
@@ -76,7 +85,6 @@ fpath_prepend \
"$(brew --prefix)/share/zsh-completions" \
"$ZDOTDIR/completions"
#------------------------------ history ------------------------------
setopt appendhistory # append to history
setopt sharehistory # share history across multiple sessions
@@ -94,7 +102,7 @@ export HISTFILE=$ZDOTDIR/history
#------------------------------ cdpath ------------------------------
setopt autocd
export CDPATH=".:$DOTFILES:$HOME"
export CDPATH=".:$GHREPOS:$DOTFILES:$LOCAL_REPOS:$HOME"
#------------------------------ options ------------------------------
# (see `man zshoptions`)
@@ -134,4 +142,7 @@ autoload -Uz promptinit; promptinit
prompt pure
#------------------------------ local configs ------------------------------
_source_if "$ZDOTDIR/.zshrc-local"
cat < "$ZDOTDIR/banner"