From b8b31e59d8116b4c0d9c1329942adf130bffdd18 Mon Sep 17 00:00:00 2001 From: Deposite Pirate Date: Mon, 16 Feb 2026 05:55:47 +0100 Subject: Clean up inline functions modified: conf.d/02platform.fish --- conf.d/02platform.fish | 51 +++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/conf.d/02platform.fish b/conf.d/02platform.fish index 5cbc4cb..91ad54e 100644 --- a/conf.d/02platform.fish +++ b/conf.d/02platform.fish @@ -2,7 +2,7 @@ if status is-interactive ## Functions - function handle_colorls + function _handle_colorls if command -sq colorls alias ls 'colorls -G -F' alias ll 'colorls -G -F -l' @@ -16,7 +16,7 @@ if status is-interactive end end - function handle_eza + function _handle_eza switch $TERM case 'xterm-256color' set -f icons 'yes' @@ -55,7 +55,7 @@ if status is-interactive ### Linux - function handle_linux + function _handle_linux if command -sq dircolors; and test -f ~/.config/dircolors eval (dircolors -c ~/.config/dircolors) @@ -158,11 +158,11 @@ if status is-interactive alias_if_not nslookup systemd-resolve end - end # handle_linux + end # _handle_linux ### macOS - function handle_macos + function _handle_macos if test -d '/opt/homebrew/bin' fish_add_path --prepend --global --path '/opt/homebrew/bin' @@ -209,13 +209,13 @@ if status is-interactive end end - end # handle_macos + end # _handle_macos ### NetBSD - function handle_netbsd + function _handle_netbsd - handle_colorls + _handle_colorls alias nproc 'sysctl -n hw.ncpu' alias free 'vmstat' @@ -239,13 +239,13 @@ if status is-interactive alias pkgclean 'doas pkgin clean' end - end # handle_netbsd + end # _handle_netbsd ### OpenBSD - function handle_openbsd + function _handle_openbsd - handle_colorls + _handle_colorls alias nproc 'sysctl -n hw.ncpu' alias free 'vmstat' @@ -278,11 +278,11 @@ if status is-interactive pkg_info -q -e "$argv->=0" end - end # handle_openbsd + end # _handle_openbsd ### FreeBSD - function handle_freebsd + function _handle_freebsd alias ls 'ls -GF' alias la 'ls -GF -a' @@ -316,25 +316,25 @@ if status is-interactive alias pkgclean 'doas pkg clean -a' end - end # handle_freebsd + end # _handle_freebsd switch (uname) case 'Linux' - handle_linux + _handle_linux case 'Darwin' - handle_macos + _handle_macos case 'OpenBSD' - handle_openbsd + _handle_openbsd case 'NetBSD' - handle_netbsd + _handle_netbsd case 'FreeBSD' - handle_freebsd + _handle_freebsd end ## All platforms if command -sq 'eza' - handle_eza + _handle_eza else if command -sq tree alias lta 'tree -a' @@ -350,7 +350,7 @@ if status is-interactive alias_if doas sudo - # process viewer to look for by order of preference + # Process viewer to look for by order of preference set topprg 'htop' 'btop' set found_topprg (find_prog $topprg) @@ -358,4 +358,13 @@ if status is-interactive alias top "$found_topprg" end + # Cleanup + functions -e _handle_eza + functions -e _handle_colorls + functions -e _handle_linux + functions -e _handle_macos + functions -e _handle_openbsd + functions -e _handle_netbsd + functions -e _handle_freebsd + end -- cgit v1.3.1