diff --git a/ps1.sh b/ps1.sh index be7249a..c2294c8 100644 --- a/ps1.sh +++ b/ps1.sh @@ -1,12 +1,15 @@ #!/usr/bin/env bash -# ps1.sh - Bash PS1 with emoji + optional animation helpers -# Source this file: source /path/to/ps1.sh -# Then enable: ps1_on -# Optional animate: psanimate 0.5 -# Stop animation: psanimate_stop -# Disable: ps1_off -# Only for interactive bash +# Must be sourced, not executed +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + echo "Dette scriptet må kjøres med:" + echo " source ps1.sh" + echo "eller:" + echo " . ps1.sh" + exit 1 +fi + +# Only for interactive shells case "$-" in *i*) ;; *) return 0 ;;