From b4b1331dc7a3bfa970f92e011e6e7a2b718afc1e Mon Sep 17 00:00:00 2001 From: Razzi Abuissa Date: Thu, 1 Feb 2024 01:24:25 -0600 Subject: [PATCH] Remove more unused functions, many macos specific --- functions/after.fish | 3 --- functions/cd-root.fish | 3 --- functions/clear-dns.fish | 3 --- functions/clone.fish | 3 --- functions/colorpicker.fish | 6 ------ functions/config.fish | 4 ---- functions/defined.fish | 3 --- functions/dim.fish | 3 --- functions/docker-launch.fish | 3 --- functions/docker-shell.fish | 6 ------ functions/dollar.fish | 5 ----- functions/download-exercism.fish | 6 ------ functions/draw-line.fish | 4 ---- functions/ec.fish | 8 -------- functions/edit-private.fish | 8 -------- functions/file-sizes.fish | 4 ---- functions/foreach.fish | 5 ----- functions/get-source.fish | 5 ----- functions/goto.fish | 3 --- functions/hack.fish | 3 --- functions/last-word.fish | 3 --- functions/new-vm.fish | 6 ------ functions/notify.fish | 3 --- functions/nowifi.fish | 3 --- functions/open-action.fish | 3 --- functions/open-jupyter.fish | 3 --- functions/post.fish | 12 ------------ functions/ppgrep.fish | 3 --- functions/presskeys.fish | 5 ----- functions/push.fish | 3 --- functions/redo.fish | 3 --- functions/see.fish | 3 --- functions/sleep-notify.fish | 3 --- functions/time-until.fish | 5 ----- functions/ved.fish | 7 ------- functions/wait-notify.fish | 4 ---- 36 files changed, 157 deletions(-) delete mode 100644 functions/after.fish delete mode 100644 functions/cd-root.fish delete mode 100644 functions/clear-dns.fish delete mode 100644 functions/clone.fish delete mode 100644 functions/colorpicker.fish delete mode 100644 functions/config.fish delete mode 100644 functions/defined.fish delete mode 100644 functions/dim.fish delete mode 100644 functions/docker-launch.fish delete mode 100644 functions/docker-shell.fish delete mode 100644 functions/dollar.fish delete mode 100644 functions/download-exercism.fish delete mode 100644 functions/draw-line.fish delete mode 100644 functions/ec.fish delete mode 100644 functions/edit-private.fish delete mode 100644 functions/file-sizes.fish delete mode 100644 functions/foreach.fish delete mode 100644 functions/get-source.fish delete mode 100644 functions/goto.fish delete mode 100644 functions/hack.fish delete mode 100644 functions/last-word.fish delete mode 100644 functions/new-vm.fish delete mode 100644 functions/notify.fish delete mode 100644 functions/nowifi.fish delete mode 100644 functions/open-action.fish delete mode 100644 functions/open-jupyter.fish delete mode 100644 functions/post.fish delete mode 100644 functions/ppgrep.fish delete mode 100644 functions/presskeys.fish delete mode 100644 functions/push.fish delete mode 100644 functions/redo.fish delete mode 100644 functions/see.fish delete mode 100644 functions/sleep-notify.fish delete mode 100644 functions/time-until.fish delete mode 100644 functions/ved.fish delete mode 100644 functions/wait-notify.fish diff --git a/functions/after.fish b/functions/after.fish deleted file mode 100644 index 2a43d3a..0000000 --- a/functions/after.fish +++ /dev/null @@ -1,3 +0,0 @@ -function after --argument pattern - awk "/$pattern/,0" -end diff --git a/functions/cd-root.fish b/functions/cd-root.fish deleted file mode 100644 index be23b3f..0000000 --- a/functions/cd-root.fish +++ /dev/null @@ -1,3 +0,0 @@ -function cd-root - cd (git root) -end diff --git a/functions/clear-dns.fish b/functions/clear-dns.fish deleted file mode 100644 index 4c19319..0000000 --- a/functions/clear-dns.fish +++ /dev/null @@ -1,3 +0,0 @@ -function clear-dns - sudo killall -HUP mDNSResponder -end diff --git a/functions/clone.fish b/functions/clone.fish deleted file mode 100644 index bd60327..0000000 --- a/functions/clone.fish +++ /dev/null @@ -1,3 +0,0 @@ -function clone --argument url - clone-cd $url ~/forks/(repo-from-url $url) -end diff --git a/functions/colorpicker.fish b/functions/colorpicker.fish deleted file mode 100644 index 4ebe02b..0000000 --- a/functions/colorpicker.fish +++ /dev/null @@ -1,6 +0,0 @@ -function colorpicker - set rgb (osascript -e 'choose color' | string split ,) - for color in $rgb - printf %02x (math round $color / (printf %d 0x101)) - end -end diff --git a/functions/config.fish b/functions/config.fish deleted file mode 100644 index 4480ec5..0000000 --- a/functions/config.fish +++ /dev/null @@ -1,4 +0,0 @@ -function config --argument KEY VALUE - echo export $KEY=\"$VALUE\" >>~/.profile - source ~/.profile -end diff --git a/functions/defined.fish b/functions/defined.fish deleted file mode 100644 index 54f99ff..0000000 --- a/functions/defined.fish +++ /dev/null @@ -1,3 +0,0 @@ -function defined --argument var - set -q $var[1] -end diff --git a/functions/dim.fish b/functions/dim.fish deleted file mode 100644 index 89eb39f..0000000 --- a/functions/dim.fish +++ /dev/null @@ -1,3 +0,0 @@ -function dim - brightness 0 -end diff --git a/functions/docker-launch.fish b/functions/docker-launch.fish deleted file mode 100644 index cf9d4e4..0000000 --- a/functions/docker-launch.fish +++ /dev/null @@ -1,3 +0,0 @@ -function docker-launch - docker run -it (docker build -q .) -end diff --git a/functions/docker-shell.fish b/functions/docker-shell.fish deleted file mode 100644 index a71d002..0000000 --- a/functions/docker-shell.fish +++ /dev/null @@ -1,6 +0,0 @@ -function docker-shell - set tmpfile (mktemp) - docker build . | tee $tmpfile # todo maybe do a --no-cache option - set image_id (tail -1 $tmpfile | last-col) - docker run --interactive --tty $image_id | tee -a (isodatetime).log -end diff --git a/functions/dollar.fish b/functions/dollar.fish deleted file mode 100644 index 94c5ae8..0000000 --- a/functions/dollar.fish +++ /dev/null @@ -1,5 +0,0 @@ -function dollar --description 'Remove the starting $ from example shell commands' - while read -l line - eval (echo $line | cut -d ' ' -f 2-) - end -end diff --git a/functions/download-exercism.fish b/functions/download-exercism.fish deleted file mode 100644 index 75272ef..0000000 --- a/functions/download-exercism.fish +++ /dev/null @@ -1,6 +0,0 @@ -function download-exercism --argument track - curl -LS https://exercism.io/tracks/$track/exercises | grep "/tracks/$track/exercises/" | awk '{print $3}' | cut -d/ -f5 | cut -d\" -f1 >~/Exercism/$track-exercises.txt - cat ~/Exercism/$track-exercises.txt | while read -l exercise - exercism download --exercise="$exercise" --track=$track - end -end diff --git a/functions/draw-line.fish b/functions/draw-line.fish deleted file mode 100644 index 53c6f76..0000000 --- a/functions/draw-line.fish +++ /dev/null @@ -1,4 +0,0 @@ -function draw-line - seq $COLUMNS | string replace -r '\d+' - | string join '' - -end diff --git a/functions/ec.fish b/functions/ec.fish deleted file mode 100644 index 45f5c8d..0000000 --- a/functions/ec.fish +++ /dev/null @@ -1,8 +0,0 @@ -# Defined in /var/folders/7v/b0z6dsqj1fx8k5rf8x121l580000gn/T//fish.egdHMw/ec.fish @ line 2 -function ec - touch $argv - emacsclient -n $argv ^/dev/null - if test $status = 1 - open -a /Applications/Emacs.app/ -- $argv - end -end diff --git a/functions/edit-private.fish b/functions/edit-private.fish deleted file mode 100644 index 6de2090..0000000 --- a/functions/edit-private.fish +++ /dev/null @@ -1,8 +0,0 @@ -function edit-private --argument name - mkdir -p ~/.config/fish/functions/private - set file ~/.config/fish/functions/private/$name.fish - echo "function $name" >>$file - echo end >>$file - $EDITOR $file - source $file -end diff --git a/functions/file-sizes.fish b/functions/file-sizes.fish deleted file mode 100644 index ea947c0..0000000 --- a/functions/file-sizes.fish +++ /dev/null @@ -1,4 +0,0 @@ -function file-sizes --argument _dir - set dir (default $_dir .) - du -sh $dir/* | gsort -h -end diff --git a/functions/foreach.fish b/functions/foreach.fish deleted file mode 100644 index a5450e0..0000000 --- a/functions/foreach.fish +++ /dev/null @@ -1,5 +0,0 @@ -function foreach --argument command - for arg in $argv[2..] - fish -c "$command $arg" - end -end diff --git a/functions/get-source.fish b/functions/get-source.fish deleted file mode 100644 index 52a43de..0000000 --- a/functions/get-source.fish +++ /dev/null @@ -1,5 +0,0 @@ -function get-source --argument app - set formula_path (brew edit --print-path $app) - set github_url (cat $formula_path | grep github | coln 2 | string trim -c \") - clone $github_url -end diff --git a/functions/goto.fish b/functions/goto.fish deleted file mode 100644 index 74d9c1e..0000000 --- a/functions/goto.fish +++ /dev/null @@ -1,3 +0,0 @@ -function goto --argument where - cd (fd $where) -end diff --git a/functions/hack.fish b/functions/hack.fish deleted file mode 100644 index 080c2fb..0000000 --- a/functions/hack.fish +++ /dev/null @@ -1,3 +0,0 @@ -function hack - cd ~/hack -end diff --git a/functions/last-word.fish b/functions/last-word.fish deleted file mode 100644 index d38c9a5..0000000 --- a/functions/last-word.fish +++ /dev/null @@ -1,3 +0,0 @@ -function last-word - awk '{print $NF}' -end diff --git a/functions/new-vm.fish b/functions/new-vm.fish deleted file mode 100644 index f99facf..0000000 --- a/functions/new-vm.fish +++ /dev/null @@ -1,6 +0,0 @@ -function new-vm - mkdir-cd ~/hack/vm-(isodatetime) - vagrant init debian/bullseye64 - vagrant up - vagrant ssh -end diff --git a/functions/notify.fish b/functions/notify.fish deleted file mode 100644 index 7a61b0c..0000000 --- a/functions/notify.fish +++ /dev/null @@ -1,3 +0,0 @@ -function notify - say notify -end diff --git a/functions/nowifi.fish b/functions/nowifi.fish deleted file mode 100644 index e0542cb..0000000 --- a/functions/nowifi.fish +++ /dev/null @@ -1,3 +0,0 @@ -function nowifi - networksetup -setairportpower en0 off -end diff --git a/functions/open-action.fish b/functions/open-action.fish deleted file mode 100644 index 20f4d39..0000000 --- a/functions/open-action.fish +++ /dev/null @@ -1,3 +0,0 @@ -function open-action - open https://github.com/$GITHUB_USERNAME/(basename $PWD)/commit/(git commit-id)/checks -end diff --git a/functions/open-jupyter.fish b/functions/open-jupyter.fish deleted file mode 100644 index bc9832c..0000000 --- a/functions/open-jupyter.fish +++ /dev/null @@ -1,3 +0,0 @@ -function open-jupyter - open http://localhost:8888 -end diff --git a/functions/post.fish b/functions/post.fish deleted file mode 100644 index aef6143..0000000 --- a/functions/post.fish +++ /dev/null @@ -1,12 +0,0 @@ -function post - cd ~/razzius.github.io/ - set title "$argv" - set slug (echo $argv | sed 's/ /-/g' | string lower) - set date (date +%Y-%m-%d) - set filename _posts/$date-$slug.md - - echo >$filename --- - echo >>$filename title: $title - echo >>$filename date: $date - echo >>$filename --- -end diff --git a/functions/ppgrep.fish b/functions/ppgrep.fish deleted file mode 100644 index f16ce93..0000000 --- a/functions/ppgrep.fish +++ /dev/null @@ -1,3 +0,0 @@ -function ppgrep --argument pattern - pgrep $pattern | xargs pstree -end diff --git a/functions/presskeys.fish b/functions/presskeys.fish deleted file mode 100644 index 79a9bec..0000000 --- a/functions/presskeys.fish +++ /dev/null @@ -1,5 +0,0 @@ -function presskeys --argument keys - osascript -e "tell application \"System Events\" - keystroke \"$keys\" -end tell" -end diff --git a/functions/push.fish b/functions/push.fish deleted file mode 100644 index b63f782..0000000 --- a/functions/push.fish +++ /dev/null @@ -1,3 +0,0 @@ -function push --argument path - git -C $path push -end diff --git a/functions/redo.fish b/functions/redo.fish deleted file mode 100644 index 17a8a36..0000000 --- a/functions/redo.fish +++ /dev/null @@ -1,3 +0,0 @@ -function redo - eval "$failed_command" -end diff --git a/functions/see.fish b/functions/see.fish deleted file mode 100644 index b40cb0b..0000000 --- a/functions/see.fish +++ /dev/null @@ -1,3 +0,0 @@ -function see --argument command - less (which $command) -end diff --git a/functions/sleep-notify.fish b/functions/sleep-notify.fish deleted file mode 100644 index 1b699cb..0000000 --- a/functions/sleep-notify.fish +++ /dev/null @@ -1,3 +0,0 @@ -function sleep-notify --argument time - fish -c "sleep $time; notify" & -end diff --git a/functions/time-until.fish b/functions/time-until.fish deleted file mode 100644 index 0baaf80..0000000 --- a/functions/time-until.fish +++ /dev/null @@ -1,5 +0,0 @@ -function time-until --argument time - set target (chrono $time -f %s) - set now (date +%s) - math $target - $now -end diff --git a/functions/ved.fish b/functions/ved.fish deleted file mode 100644 index a606899..0000000 --- a/functions/ved.fish +++ /dev/null @@ -1,7 +0,0 @@ -function ved - if string-empty $VIM_TERMINAL - vim $argv - else - vim-call Tapi_TerminalEdit $argv - end -end diff --git a/functions/wait-notify.fish b/functions/wait-notify.fish deleted file mode 100644 index 7d6ba17..0000000 --- a/functions/wait-notify.fish +++ /dev/null @@ -1,4 +0,0 @@ -function wait-notify --argument time - set seconds (time-until $time) - bash -c "sleep $seconds; notify" & -end -- 2.45.2