Bash: update magick wrapper

This commit is contained in:
Akemi Izuko 2024-07-10 21:18:59 -06:00
parent 388b275bd0
commit a8c315f5b4
Signed by: akemi
GPG key ID: 8DE0764E1809E9FC

View file

@ -298,13 +298,13 @@ function ta() {
# Image magick ====================================================== # Image magick ======================================================
function magika() { function magika() {
if [[ "$1" == "a" || "$1" == "av1" ]]; then if [[ "$1" == "a" || "$1" == "av1" ]]; then
magick convert "$2" "${2%.*}.avif" magick "$2" "${2%.*}.avif"
elif [[ "$1" == "i" ]]; then elif [[ "$1" == "i" ]]; then
shift shift
magick identify "$@" magick identify "$@"
elif [[ "$1" == "c" ]]; then elif [[ "$1" == "c" ]]; then
shift shift
magick convert "$@" magick "$@"
else else
magick "$@" magick "$@"
fi fi
@ -337,5 +337,21 @@ function truecolor () {
source ~/.bash_prompt source ~/.bash_prompt
} }
# Navigate to the project root ======================================
rooter() {
local current_dir="$PWD"
while [[ "$current_dir" != "/" ]]; do
if [[ -d "$current_dir/.git" ]]; then
cd "$current_dir"
return 0
else
current_dir="$(dirname "$current_dir")"
fi
done
echo "No .git directory found above cwd." >&2
return 1
}
# vim: set ft=bash ff=unix: # vim: set ft=bash ff=unix: