12345678910111213141516171819202122232425262728293031 |
- #!/usr/bin/env bash
- set -euo pipefail
- DATE="$(date +%F_%H%M%S)"
- SCRIPT_NAME="${0##*/}"
- LOG_DIR="${HOME}/.local/share/logs"
- LOG_FILE="${LOG_DIR}/${SCRIPT_NAME%%.sh}_${DATE}.log"
- display_help() {
- error_message="$*"
- [[ -n ${error_message:} ]] && echo -e "Error: ${error_message}\n"
- cat <<EOF
- Description: Launch emacs -Q with littering enabled to not clutter emacs home
- Usage: ${SCRIPT_NAME} [optional arg/s] <mandatory arg/s>
- Dependencies: emacs no-littering
- Examples:
- - ${SCRIPT_NAME}
- EOF
- exit 2
- }
- message(){
- info="$*"
- echo "==== $(date +'%F_%H%M%S') ==== ${info} ====" | tee -a "$LOG_FILE"
- }
- LIB_DIR="${EMACS_CONFIG_DIR}/elpa"
- mapfile -t libs < <(find "$LIB_DIR" -maxdepth 1 -type d -regex '.*\(no-littering\|compat\).*')
- message "launching emacs with loaded libraries: ${libs[*]}"
- emacs -Q -L "${libs[0]}" -L "${libs[1]}" -l no-littering
|