From 85f45a9e8a4b123895bf8dbc0b906a77d02fb03e Mon Sep 17 00:00:00 2001 From: rootiest Date: Thu, 30 Apr 2026 23:32:37 -0400 Subject: [PATCH] refactor: properly alias cb to y Instead of re-defining the same behavior, just write `cb` into the y.fish function file as an alias for y --- functions/cb.fish | 22 ---------------------- functions/y.fish | 5 +++++ 2 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 functions/cb.fish diff --git a/functions/cb.fish b/functions/cb.fish deleted file mode 100644 index 35b721b..0000000 --- a/functions/cb.fish +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (C) 2026 Rootiest -# SPDX-License-Identifier: AGPL-3.0-or-later - -# Copy to clipboard -function cb --description 'Copy to clipboard' - if type -q wl-copy - if set -q argv[1] - echo $argv | wl-copy - else - wl-copy - end - else if type -q xclip - if set -q argv[1] - echo $argv | xclip -selection clipboard - else - xclip -selection clipboard - end - else - echo "Error: No clipboard provider found." >&2 - return 1 - end -end diff --git a/functions/y.fish b/functions/y.fish index e2a11f8..1abd133 100644 --- a/functions/y.fish +++ b/functions/y.fish @@ -35,3 +35,8 @@ function y --description 'Yank to clipboard' eval $copy_cmd end end + +# Alias cb=y +function cb --wraps='y' --description 'Alias cb=y' + y $argv +end \ No newline at end of file