Added terminalTweaks.txt.

master
parent c89dfbe95b
commit 71041266d0

@ -6,6 +6,8 @@
This script will convert your HEIC files (a format Apple saves photos with) to JPGs. Flip saveasjpg at the top to save as PNG instead. This will result in much larger file sizes. Set keeporiginals to 0 to delete the HEIC files after they're converted. The HEIC files are saved kept around by default. For best results set this up as a cron job.
\* Requires the ImageMagick CLI software to be installed with HEIC support. There are links at the top of the script to do this.
**terminalTweaks.txt**
This isn't so much a script as some small quality of life improvements I've made to my WSL Ubuntu 20.04 systems and Ubuntu 20.04 server. Add whichever you like to the end of your .profile and use 'source ~/.profile' to load it immediately.
### AutoHotKey

@ -0,0 +1,22 @@
# This turns your long terminal prompt into a shorter prompt.
# (inspired by CentOS's current-folder-only prompt and mixed with Ubuntu's full path prompt).
me=`whoami`
PROMPT_COMMAND='_dir=`pwd`;if [ ${#_dir} -ge 35 ]; then _mydir=`pwd | cut -c1-16`; _mydir=${_mydir}.../`pwd | rev | cut -d/ -f1 | rev`; else _mydir=`pwd`; fi; _mydir=`echo $_mydir | sed "s/^\/home\/$me/~/g"`; PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u\[\033[1;31m\]@\[\033[1;33m\]\h\[\033[00m\]:\[\033[0;36m\]$_mydir\[\033[00m\]\$ "'
# Sometimes sudo doesn't show colors. The space after the command fixes this for some reason
alias sudo="sudo "
# When launching Ubutnu WSL this makes sure we start in our home directory instead of the
# system32 directory (caused by run -> ubuntu2004) or the Windows user's home directory.
# (replace root in /mnt/c/Users/root with your Windows user's username for proper detection)
bashrc_start_dir=`pwd`
if [[ $bashrc_start_dir == "/mnt/c/Users/root" || $bashrc_start_dir == "/mnt/c/Windows/system32" ]]
then
cd
fi
# Ever wanted to open Windows explorer in whatever directory you're in to work on the files
# in Windows? Well this allows you to do exactly that, just like in the Command Prompt.
alias explorer=explorer.exe
Loading…
Cancel
Save