Last active
March 5, 2025 07:20
-
-
Save jetsonhacks/9faeafaa0d287d5e3580c29898931798 to your computer and use it in GitHub Desktop.
Terminal for Videos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this in a Terminal to remove the name of the SSD you're using; shortens prompt | |
shorten_path() { | |
local full_path="$PWD" | |
if [[ "$full_path" =~ ^/media/"$USER"/[^/]* ]]; then | |
local prefix="${BASH_REMATCH[0]}" | |
echo "~${full_path#$prefix}" | |
else | |
echo "$full_path" | |
fi | |
} | |
export PS1='\[\e[32m\]\u@\h\[\e[0m\]:\[\e[34m\]$(shorten_path)\[\e[0m\]\$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment