diff --git a/README.md b/README.md index afbdb4d..0b0d835 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,8 @@ This config layers on top of the CachyOS base Fish configuration and adds: │ ├── fzf.fish # FZF key binding initialization │ ├── tailscale.fish # Tailscale CLI completions │ ├── theme.fish # Theme syntax highlighting colors -│ ├── tricks.fish # PATH additions, bang-bang helpers, history/backup utilities +│ ├── done.fish # Done plugin (desktop notifications for long commands) +│ ├── tricks.fish # PATH, bang-bang helpers, bat man pages, system aliases, history/backup utilities │ ├── wakatime.fish # WakaTime shell hook │ └── zoxide.fish # Zoxide z/zi aliases ├── functions/ # Custom functions (one per file) @@ -137,6 +138,24 @@ Every shell command is reported to WakaTime for time-tracking. Disable by settin Full tab completion for the `tailscale` CLI is provided via `conf.d/tailscale.fish`. +### bat Man Pages + +When `bat` is installed, man pages are automatically rendered through it for syntax highlighting. `MANPAGER` and `MANROFFOPT` are set in `conf.d/tricks.fish`: + +```fish +set -gx MANROFFOPT -c +set -gx MANPAGER "sh -c 'col -bx | bat -l man -p'" +``` + +### Done Notifications + +Desktop notifications for long-running commands via [franciscolourenco/done](https://github.com/franciscolourenco/done). A notification fires when a command takes longer than 10 seconds and the terminal window is not focused. + +| Variable | Value | Description | +|---|---|---| +| `__done_min_cmd_duration` | `10000` ms | Minimum duration before a notification is sent | +| `__done_notification_urgency_level` | `low` | Desktop notification urgency | + --- ## Key Bindings @@ -307,6 +326,8 @@ Install method priority: **git+cargo source build** (fish) → **cargo** (other | `wake-lock ` | Run a command with `systemd-inhibit` to prevent sleep | | `swapstat` | Colorized zRAM compression ratio, swappiness, and swap priority report | | `sudo-toggle` | Toggle sudo password bypass — writes/clears a `NOPASSWD` rule in `/etc/sudoers.d/nofail-toggle` | +| `psmem` | List all processes sorted by memory usage (descending) | +| `psmem10` | Top 10 processes by memory usage | | `tmux-clean` | Kill all detached tmux sessions | | `limine-edit` | Safely edit and re-verify Limine bootloader configuration | | `sbver` | Verify bootloader signing status for Secure Boot | @@ -361,6 +382,60 @@ Install method priority: **git+cargo source build** (fish) → **cargo** (other | `backup ` | Copy `` to `.bak` | | `bash` | Drop into bash (raw Fish session via `rawfish`) | +### Shell Aliases + +These aliases are defined in `conf.d/tricks.fish` via `alias` (which creates Fish functions). They are active in all interactive sessions. + +#### Navigation + +| Alias | Expands To | +|---|---| +| `..` | `cd ..` | +| `...` | `cd ../..` | +| `....` | `cd ../../..` | +| `.....` | `cd ../../../..` | +| `......` | `cd ../../../../..` | + +#### Color Overrides + +Force color output for common tools: + +| Alias | Command | +|---|---| +| `grep` | `grep --color=auto` | +| `fgrep` | `fgrep --color=auto` | +| `egrep` | `egrep --color=auto` | +| `dir` | `dir --color=auto` | +| `vdir` | `vdir --color=auto` | + +#### Safety Wrappers + +These aliases add `-i` (interactive confirmation) to destructive commands: + +| Alias | Command | +|---|---| +| `cp` | `cp -i` | +| `mv` | `mv -i` | +| `rm` | `rm -i` | + +> [!NOTE] +> The `rm` alias applies only when no custom `rm` function from `functions/rm.fish` takes precedence. The trash-aware `rm` wrapper in `functions/rm.fish` is the primary handler for interactive sessions. + +#### Archives & Networking + +| Alias | Command | Description | +|---|---|---| +| `tarnow` | `tar -acf` | Create a compressed archive (auto-detects format from extension) | +| `untar` | `tar -zxvf` | Extract a gzip-compressed archive | +| `wget` | `wget -c` | Resume interrupted downloads by default | +| `tb` | `nc termbin.com 9999` | Pipe content to [termbin.com](https://termbin.com) for quick sharing | + +#### System Logs + +| Alias | Command | Description | +|---|---|---| +| `jctl` | `journalctl -p 3 -xb` | Show priority-3 (error) journal entries from the current boot | + --- ## Abbreviations diff --git a/conf.d/done.fish b/conf.d/done.fish new file mode 100644 index 0000000..9252660 --- /dev/null +++ b/conf.d/done.fish @@ -0,0 +1,340 @@ +# MIT License + +# Copyright (c) 2016 Francisco Lourenço & Daniel Wehner + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if not status is-interactive + exit +end + +set -g __done_version 1.19.1 + +function __done_run_powershell_script + set -l powershell_exe (command --search "powershell.exe") + + if test $status -ne 0 + and command --search wslvar + + set -l powershell_exe (wslpath (wslvar windir)/System32/WindowsPowerShell/v1.0/powershell.exe) + end + + if string length --quiet "$powershell_exe" + and test -x "$powershell_exe" + + set cmd (string escape $argv) + + eval "$powershell_exe -Command $cmd" + end +end + +function __done_windows_notification -a title -a message + if test "$__done_notify_sound" -eq 1 + set soundopt "