- Other my dotfiles
- You can find them here: Antony-hash512_dotfiles
- Other vesions:
- For Synology NAS: Fish_functions_collection_for_DSM
This repository contains a collection of custom functions for the Fish shell. These scripts are designed to automate daily tasks, manage system configurations, handle file operations, and improve the overall terminal experience.
Many functions include interactive elements, color-coded output, and safety checks.
This is the active development branch (bleeding edge). New features land here first, which may result in a mix of English and Russian in code comments and output.
An English-only stable branch is planned for the future.
⚠️ Warning: If you already have custom fish functions in your local config (~/.config/fish/functions/), installing via Fisher may overwrite files with matching names.
- Check for conflicts: Ensure your existing functions do not share names with the functions in this repository.
- Manual approach: If you are unsure, it is recommended to copy only the specific files you need manually (see below).
- Conflict resolution: You can use the
frenameutility included in this collection to easily rename functions if you need to resolve naming collisions.
fisher install Antony-hash512/Fish_functions_collectionClone the repository and copy functions to ~/.config/fish/functions/.
After I sort the functions into subdirectories (categories), you also need to copy the script from my repository's conf.d to your ~/.config/fish/conf.d.
💡 Pro Tip: For granular control, use a visual diff tool (like Meld or KDiff3) to compare the cloned
functions/directory against your local~/.config/fish/functions/and inspect individual files.If you are working remotely (SSH) or prefer the terminal, use
vimdiff(ornvim -d). You can also use Midnight Commander (mc) with its Compare Directories (C-x d) or Compare Files (C-x C-d) hotkeys to view differences side-by-side and interactively merge changes.This allows you to visually inspect differences and safely transfer entire files or merge specific parts of the code without blindly overwriting your existing configuration.
When the number of functions grew too large, I decided to organize them by categories. To achieve this, symbolic links to the functions are distributed within the sorted directory and its category subdirectories. For compatibility with Fisher, I decided against sorting functions into subdirectories directly inside the functions directory (which would otherwise require a custom initialization script in conf.d).
| Function Name | Description | Possible Keys / Arguments | Dependencies | Language (Comments/Desc) |
|---|---|---|---|---|
| add_subtitle_hint | Add a subtitle hint overlay to a video (e.g., CC/Subtitle turn on prompt). | <input> <output> |
ffmpeg, magick, video_resolution (function) |
Russian |
| android_send | Interactive file sending to Android via ADB. | Interactive | adb |
Russian |
| apply_hardsubs | Burn ASS subtitles into a video file using NVENC hardware acceleration (hevc_nvenc). |
[-s/--sub <file>] <video_file> |
ffmpeg |
Russian |
| check_bin | Check if a binary exists in Arch Linux repos or AUR. | <package_name> |
pacman, paru |
English |
| check_remote_ssh_logs | Monitor failed SSH login attempts on a remote server. | N/A | ssh |
Russian |
| concatenate_videos | Seamlessly concatenate multiple video files using FFmpeg (without re-encoding). | <input1> <input2> ... <output> |
ffmpeg |
Russian |
| deluge_extract | Extract .torrent files from Deluge state based on a download path. |
<search_path> [dest_dir] |
deluge |
Mixed: Russian (Interface, source code comments) / English (description) |
| deluge_extract2 | Advanced extraction of .torrent files by Path OR by Name. |
<search_term> [dest_dir], --name (-n) |
deluge |
Mixed: Russian (Interface, source code comments) / English (description) |
| extract_original_audio | Extract the original audio track from a video file without re-encoding. | <input_video> [output_audio] |
ffmpeg, ffprobe |
Russian |
| fedit | Find and open a fish function using fzf and your preferred editor. |
Interactive | fzf, bat (optional) |
Mixed: English (main interface) / Russian (source code comments, description and errors) |
| find_hardlinks | Find all hardlinks pointing to a specific file. | [-d /path] <file> |
N/A | Russian |
| fish_greeting | Customizes or suppresses the default Fish shell greeting. | N/A | N/A | Interface: N/A, Description: English, Mixed source code comments: English / Russian |
| fish_prompt | A custom, informative prompt with git status, error codes, and icons. | N/A | git (optional for vcs prompt) |
Interface: N/A, Description: English, Source code comments: Russian |
| fix_srt_numbers | Renumber and fix SRT subtitle file formatting using FFmpeg. | <input.srt> [output.srt] |
ffmpeg |
Russian |
| frename | Rename a fish function (both the file and the internal function name). | <old_name> <new_name> |
N/A | Interface: N/A, Description/Source code comments: Russian |
| gdisk_mount | Mount Google Drive using rclone (requires existing gdrive config). |
N/A | rclone |
English |
| get_root_cmd | Safely detect root privilege command (sudo, doas, run0 etc.) using a whitelist. |
N/A | N/A | English description, Russian comments |
| git_check_updates | Visual git history overview for all branches. | N/A | git |
English |
| hardlinks-cp | Recursive hardlink copy (safe wrapper for cp -al). |
<source> <dest> |
N/A | Russian |
| last_pkgs | Show the list of most recently installed packages (Arch Linux). | [limit] |
expac |
Russian |
| launch_cosyvoice_server | Automatically install, configure, and launch CosyVoice 3 TTS web server with Russian support. | N/A | git, uv, torch, gradio |
Russian |
| mancat | Output the content of a man page directly to the terminal (no pager). | <man_page> |
N/A | Interface: N/A, Description/Source code comments: Russian |
| mancopy | Copy the content of a man page to the system clipboard. | <man_page> |
wl-clipboard (Wayland) or xsel (X11) |
Interface: N/A, Description/Source code comments: Russian |
| merge_image_sequences | Merge multiple folders containing PNG image frames into a single continuous sequence using hard links. | [options] <folder1> <folder2> ... |
N/A | Russian |
| migrate_antigravity_settings | Migrate user settings and plugins to standard Antigravity IDE configuration directories. | N/A | N/A | Russian |
| mount-remote-dir-by-rclone | Mount remote directories using rclone (interactive wizard available). |
[up/down/list/forget] |
rclone, get_root_cmd (function) |
Mixed |
| mount-remote-dir-by-smb | Mount remote SMB/CIFS shares (interactive wizard available). | [up/down/list/forget] |
cifs-utils, get_root_cmd (function) |
Mixed |
| mount-remote-dir-by-webdav | Mount remote WebDAV directories (davfs2) (interactive wizard available). | [up/down/list/forget] |
davfs2, get_root_cmd (function) |
Mixed |
| my_fish_functions | List all custom functions in this collection with their descriptions. | --all |
N/A | Russian |
| nat_off4nas_iptables | Disable NAT and clear iptables rules for internet sharing. |
N/A | iptables |
Russian |
| nat_on4nas_iptables | Enable NAT to share internet to another device (e.g., NAS) interactively. | Interactive | iptables, iproute2 |
Russian |
| nvim | Wrapper to run Neovim with SHELL=/bin/bash (compatibility fix). |
[args...] |
neovim |
Interface: N/A, Description/Source code comments: Russian |
| paru_clean | Clean paru (AUR helper) cache, keeping the last N versions. |
-k <N>, --deep, --deep-all |
pacman-contrib, paru, git |
Russian |
| pass | Smart password manager wrapper (auto-pull on modify + Vim). | [args...] |
pass, git |
English |
| persistent_ssh | Establish an SSH connection with auto-reconnect on connection drop. | [args...] |
ssh |
Russian |
| record_system_audio | Interactively record system audio output. | Interactive | ffmpeg, fzf |
Russian |
| reflinks-cp | Copy with reflink=always (Cow) (wrapper for cp). |
[source] [dest] |
N/A | Russian comments, English description |
| rename_frames_sequentially | Rename a sequence of frame files (e.g., PNGs) sequentially starting from 1 with no gaps. | N/A | N/A | Russian |
| replace_audio | Replace the audio track in a video file with a new one, re-encoding the audio stream to AAC (320 kbps). | <video_file> <audio_file> [output_file] |
ffmpeg |
Russian |
| replace_audio_track | Replace video audio track with fade-out effect. | <video> <audio> |
ffmpeg |
Russian |
| rm-if-empty | Safely remove directory ONLY if it contains 0-byte files or empty directories. | <target_dir> |
find |
Russian comments, English description |
| rsync2nas_move | Move files to NAS using rsync with size-only check. |
<source> <target> |
rsync |
Russian |
| save_local_torrents | Export loaded .torrent files from local Deluge with human-readable names. |
[dest_dir] |
deluge |
Mixed: Russian (Interface, source code comments) / English (description) |
| save_qr | Generate a QR code and save it to a PNG file (uses qrencode). |
<filename> <text> |
qrencode |
Russian code comments, English description |
| say-en-direct | Speak English text from clipboard/args (Piper + choice). | [text] |
piper, fzf |
Russian |
| say-en-kokoro | High-quality American English TTS (Kokoro Smart Context). | [text], --fast, --save, --play-and-save |
uv, torch, kokoro |
English |
| say-ru | Speak Russian text from clipboard/args (Wayland/X11). | [text] |
speech-dispatcher |
Russian |
| say-ru-betatest1-direct | Russian TTS (Piper: Irina) with device selection. | [text] |
piper, fzf |
Russian |
| say-ru-correct-stress | Russian TTS with automatic stress correction (VITS). | [text], --fast, --save, --play-and-save |
uv, transformers, ruaccent |
Russian |
| say-ru-direct | Speak Russian text from clipboard/args (Piper). | [text] |
piper |
Russian |
| say-stop | Stop all current speech synthesis processes. | N/A | speech-dispatcher |
English |
| separate_audio | Separate audio into vocals and background music using audio-separator. |
<file> [extra_args] |
uv (audio-separator via uvx) |
Russian |
| shift_subtitles | Shift timings in SRT subtitle files by a specified amount of seconds. | <file.srt> <seconds> [--nobkp] |
uv |
Russian |
| show_qr | Display a QR code directly in the terminal (ANSI UTF8). | <text> |
qrencode |
Russian code comments, English description |
| smart-mv | "Smart Move": Safely move files handling recursion, duplicates, and name conflicts. | file1 [file2...] <dest_dir> |
rsync |
Russian |
| squash_manager | Smartly manage SquashFS: create (optional encryption), mount, and umount. | create [OPTIONS] <input> [output], mount <img/mnt>, umount <mnt> |
squashfs-tools, cryptsetup (for -e), tar2sqfs (for archives) |
Mixed |
| squash_manager6 | Ultimate SquashFS manager: Supports RAM-build for max speed + Encryption. | create [OPTIONS] <input> [output], mount <img/mnt>, umount <mnt> |
squashfs-tools, cryptsetup (for -e), tar2sqfs (for archives) |
Mixed |
| srt2wav | Generate individual WAV files from SRT subtitles (using Kokoro TTS) and assemble them into a final timed WAV track. | <input.srt> <output_dir> |
awk, say-en-kokoro (function), ffmpeg |
Russian |
| super_shred | Securely wipe files (3 passes + zeroing). | <file> |
shred |
Russian |
| sudo | Wrapper for sudo-rs (Rust implementation) with fallback to standard sudo. |
[args...] |
sudo-rs (optional), sudo (standard) |
Interface: N/A, Decription/source code comments: Russian |
| sudo-switch-alias | Toggle the sudo alias between the system sudo and sudo-rs. |
N/A | sudo-rs (optional) |
Russian |
| test_ssh_speed | Test SSH connection speed using pv (pipe viewer). |
<host> |
pv, openssh |
Russian code comments, English description |
| toggle_night_mode | Toggle system night mode (Redshift/etc.). | N/A | N/A | Russian |
| update-all | Perform a full system and packages/toolchain update (Arch, AUR, Flatpak, Python/uv, Rust/Cargo, Go). | N/A | paru, flatpak (optional), uv (optional), rustup (optional), cargo-install-update (optional), gup (optional) |
Mixed |
| update-grub | Shortcut to update GRUB2 configuration (Ubuntu-style style command for Arch). | N/A | grub |
Interface: N/A, Decription/source code comments: Russian |
| update_all_git_repositories | Update all git repositories in a directory. | [path], -q |
git |
Russian |
| updates_rclone | Check for updates to rclone. |
N/A | rclone |
English |
| upscale_image_realesrgan | Upscale a single image using Real-ESRGAN with anime/photo modes and resize for ComfyUI. | [-a/--anime] [-p/--photo] <input> <output> |
realesrgan-ncnn-vulkan, magick |
Mixed: Russian (comments) / English (description) |
| upscale_video_realesrgan | Upscale video using realesrgan-ncnn-vulkan (supports sequential frames extraction and assembly). |
[options] <input> <output> |
realesrgan-ncnn-vulkan, ffmpeg, ffprobe |
Russian |
| video_resolution | Get the width, height, aspect ratio, or formatted resolution of a video file. | [-w] [-h] [-r] <video_file> |
ffprobe |
Russian |
| watermark_pro | Add a watermark to video for YouTube (re-encoding) using hardware acceleration (hevc_nvenc). |
-i <video> [-w <watermark>] |
ffmpeg, video_resolution (function) |
Russian |
| which-versions | Show all installed paths and versions for a specific program. | <command> |
N/A | Russian |
| whisper_transcribe | Transcribe audio/video files into SRT subtitles using whisper.cpp (large-v3 model). | [-l/--language <lang>] <media_file> |
whisper.cpp, ffmpeg |
Mixed |
| yo_interactive | Interactive Russian "yo" letter restorer (eyoficator) with context preservation for subtitle files. | <file.srt> |
eyo (CLI), python |
Russian |
| yt-dlp-transcript | Download subtitles/transcripts from YouTube using yt-dlp. |
[url], --lang, --vtt, --text |
yt-dlp |
Russian |
| zero-kelvin-store | Zero-Kelvin Store: Freeze data to SquashFS and Unfreeze back. | freeze, unfreeze, check, --encrypt, --use-cmp, --force-delete |
squash_manager, rm-if-empty |
English |
say-ru-correct-stress "+Я горько пл+ачу, когда плач+у по сч+там за этот старинный з+амок, на дверях которого висит огромный зам+ок. Это настоящая м+ука — пытаться испечь хлеб, когда закончилась пшеничная мука+."say-en-kokoro "I present my new present."
say-en-kokoro "I object to putting this object on the table."
say-en-kokoro "I live my life and watch a live broadcast on TV."
say-en-kokoro "Please record the exact time when he breaks the world record."
say-en-kokoro "Since I already read the book yesterday, I do not want to read it again."