From 7985bf3dba930b7978cdbf18fd6c636fc9def53d Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Wed, 12 Jul 2023 10:33:40 -0500 Subject: [PATCH] Add poll script that is a better watch since it respects my aliases --- common/bin/poll | 11 +++++++++++ common/fish/config.fish | 4 ++-- common/fish/functions.fish | 5 +++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100755 common/bin/poll diff --git a/common/bin/poll b/common/bin/poll new file mode 100755 index 0000000..e44322e --- /dev/null +++ b/common/bin/poll @@ -0,0 +1,11 @@ +#!/usr/bin/env fish + +# make sure our stuff gets loaded so aliases will work +source ~/.config/fish/config.fish + +while true + clear + echo (tput setaf 0)(date) polled (tput setaf 4)"'"$argv"'"(tput setaf 7) + eval $argv + sleep 2 +end diff --git a/common/fish/config.fish b/common/fish/config.fish index c62e5a7..781d462 100755 --- a/common/fish/config.fish +++ b/common/fish/config.fish @@ -4,12 +4,12 @@ for s in $ENV_PATH/*/config.d.fish source $s (dirname $s) end -status --is-interactive || exit - for f in vars colors prompt functions key-bindings source $FISH_PATH/$f.fish end +status --is-interactive || exit + if has_command rtx rtx activate fish | source else if has_command brew && test -f (brew --prefix asdf)/libexec/asdf.fish diff --git a/common/fish/functions.fish b/common/fish/functions.fish index 00ba8be..b6aa499 100644 --- a/common/fish/functions.fish +++ b/common/fish/functions.fish @@ -22,6 +22,11 @@ if has_command rm-improved alias rm rm-improved end +if has_command thefuck + thefuck --alias | source + alias f fuck +end + function scount --wraps=count --description "Silent count exits with a non-zero status if no arguments given to count" count $argv > /dev/null end