diff --git a/fish/functions/compress_blueray_anime.fish b/fish/functions/compress_blueray_anime.fish new file mode 100644 index 0000000..2703c95 --- /dev/null +++ b/fish/functions/compress_blueray_anime.fish @@ -0,0 +1,3 @@ +function compress_blueray_anime --description 'Compress an input video file using the values I tested for my Ghost in the Shell blueray files'; + ab-av1 encode --input $argv[1] --keyint 240 --scd false --svt film-grain=4 --svt tune=3 --svt smc=0 --preset 4 --crf 14 +end \ No newline at end of file diff --git a/fish/functions/fetch.fish b/fish/functions/fetch.fish new file mode 100644 index 0000000..7dea1e0 --- /dev/null +++ b/fish/functions/fetch.fish @@ -0,0 +1,4 @@ +function fetch --wraps='nix-shell -p hyfetch -p fastfetch --run hyfetch' --description 'alias fetch=nix-shell -p hyfetch -p fastfetch --run hyfetch' + nix-shell -p hyfetch -p fastfetch --run hyfetch $argv + +end diff --git a/fish/functions/fish_prompt.fish b/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..ca63ef1 --- /dev/null +++ b/fish/functions/fish_prompt.fish @@ -0,0 +1,7 @@ +set -l nix_shell_info ( + if test -n "$IN_NIX_SHELL" + echo -n " " + end +) + +echo -n -s "$nix_shell_info ~>" \ No newline at end of file diff --git a/fish/functions/fish_right_prompt.fish b/fish/functions/fish_right_prompt.fish new file mode 100644 index 0000000..ebed866 --- /dev/null +++ b/fish/functions/fish_right_prompt.fish @@ -0,0 +1,32 @@ +function fish_right_prompt + set -g __fish_git_prompt_showdirtystate 1 + set -g __fish_git_prompt_showuntrackedfiles 1 + set -g __fish_git_prompt_showupstream informative + set -g __fish_git_prompt_showcolorhints 1 + set -g __fish_git_prompt_use_informative_chars 1 + # Unfortunately this only works if we have a sensible locale + string match -qi "*.utf-8" -- $LANG $LC_CTYPE $LC_ALL + and set -g __fish_git_prompt_char_dirtystate \U1F4a9 + set -g __fish_git_prompt_char_untrackedfiles "?" + + # The git prompt's default format is ' (%s)'. + # We don't want the leading space. + set -l vcs (fish_vcs_prompt '(%s)' 2>/dev/null) + + set -l d (set_color brgrey)(date "+%R")(set_color normal) + + set -l duration "$cmd_duration$CMD_DURATION" + if test $duration -gt 100 + set duration (math $duration / 1000)s + else + set duration + end + + set -q VIRTUAL_ENV_DISABLE_PROMPT + or set -g VIRTUAL_ENV_DISABLE_PROMPT true + set -q VIRTUAL_ENV + and set -l venv (string replace -r '.*/' '' -- "$VIRTUAL_ENV") + + set_color normal + string join " " -- $venv $duration $vcs $d +end diff --git a/fish/functions/jpegopfolder.fish b/fish/functions/jpegopfolder.fish new file mode 100644 index 0000000..097f3ef --- /dev/null +++ b/fish/functions/jpegopfolder.fish @@ -0,0 +1,4 @@ +function jpegopfolder --wraps='find . \\( -iname "*.jpg" -o -iname "*.jpeg" \\) | jpegoptim -p -P --files-stdin -w $(nproc --all)' --description 'alias jpegopfolder find . \\( -iname "*.jpg" -o -iname "*.jpeg" \\) | jpegoptim -p -P --files-stdin -w $(nproc --all)' + find . \( -iname "*.jpg" -o -iname "*.jpeg" \) | jpegoptim -p -P --files-stdin -w $(nproc --all) $argv + +end diff --git a/fish/functions/oxipng-new.fish b/fish/functions/oxipng-new.fish new file mode 100644 index 0000000..55bee91 --- /dev/null +++ b/fish/functions/oxipng-new.fish @@ -0,0 +1,4 @@ +function oxipng-new --wraps='find . -type f -newermt $(date +%m/%d/%Y) -print0 | xargs -0 oxipng -o max -p' --description 'alias oxipng-new find . -type f -newermt $(date +%m/%d/%Y) -print0 | xargs -0 oxipng -o max -p' + find . -type f -newermt $(date +%m/%d/%Y) -print0 | xargs -0 oxipng -o max -p $argv + +end diff --git a/fish/functions/render_html.fish b/fish/functions/render_html.fish new file mode 100644 index 0000000..a31d57f --- /dev/null +++ b/fish/functions/render_html.fish @@ -0,0 +1,3 @@ +function render_html --description 'gets content of provided file and renders as if it were html'; + cat $argv[1] | lynx --stdin; +end \ No newline at end of file diff --git a/fish/functions/save-disk.fish b/fish/functions/save-disk.fish new file mode 100644 index 0000000..30cc660 --- /dev/null +++ b/fish/functions/save-disk.fish @@ -0,0 +1,4 @@ +function save-disk --wraps='dd if=/dev/sr0 | pv -pteabW -s $(lsblk -b --output SIZE -n -d /dev/sr0) | cat >' --description 'alias save-disk=dd if=/dev/sr0 | pv -pteabW -s $(lsblk -b --output SIZE -n -d /dev/sr0) | cat >' + dd if=/dev/sr0 | pv -pteabW -s $(lsblk -b --output SIZE -n -d /dev/sr0) | cat > $argv + +end diff --git a/fish/functions/yt-dlp-archive.fish b/fish/functions/yt-dlp-archive.fish new file mode 100644 index 0000000..b6923a8 --- /dev/null +++ b/fish/functions/yt-dlp-archive.fish @@ -0,0 +1,4 @@ +function yt-dlp-archive --wraps='yt-dlp --write-info-json --write-description --write-thumbnail --write-sub --sub-langs all --output "videos/%(uploader).200B (%(channel_id)s)/%(upload_date)s - %(title).200B - %(id)s.%(ext)s" --cookies-from-browser firefox --format bestvideo+bestaudio/best' --description 'alias yt-dlp-archive=yt-dlp --write-info-json --write-description --write-thumbnail --write-sub --sub-langs all --output "videos/%(uploader).200B (%(channel_id)s)/%(upload_date)s - %(title).200B - %(id)s.%(ext)s" --cookies-from-browser firefox --format bestvideo+bestaudio/best' + yt-dlp --write-info-json --write-description --write-thumbnail --write-sub --sub-langs all --output "%(uploader).200B (%(channel_id)s)/%(upload_date)s - %(title).200B - %(id)s.%(ext)s" --cookies-from-browser firefox --format bestvideo+bestaudio/best $argv + +end