Grab bag of random fish scripts and functions I've collected
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add first batch of scripts

authored by

Different55 and committed by
GitHub
e10ea224 7bc5de6d

+39
+4
,rmount.fish
··· 1 + function ,rmount --wraps='rclone mount' --description 'mounts the given rclone remote (plus path) at the given name in the ~/Remotes/ folder' 2 + mkdir -p "$HOME/Remote/$argv[2]" 3 + rclone mount --daemon --vfs-cache-mode=full --vfs-fast-fingerprint --volname "$argv[2]" "$argv[1]" "$HOME/Remote/$argv[2]" 4 + end
+10
,upload.fish
··· 1 + function ,upload --wraps='rclone copy' --description 'Upload files to jaromino.com' 2 + set file (basename "$argv") 3 + set file (string escape --style=url "$file") 4 + rclone copy "$argv" Jaromino:/home/public/jaromino.com/Files/ -P --ignore-existing 5 + or return $status 6 + 7 + set url (printf "https://jaromino.com/Files/%s" "$file") 8 + echo "$url" | pbcopy 9 + printf "%s\n" "$url" 10 + end
+25
,usage.fish
··· 1 + function ,usage --wraps=du --description 'get disk usage of current working directory' 2 + argparse 'a/all' 'h/help' -- $argv 3 + if set -ql _flag_h 4 + echo "Usage: ,usage [-h | --help] [-a | -all] [directory]" 5 + echo " -h Print this help" 6 + echo " -a Scan all files and folders (including hidden ones)" 7 + echo "" 8 + echo "If no directory is provided, the current directory is assumed" 9 + return 10 + end 11 + 12 + set path "." 13 + if test -n "$argv" 14 + set path "$argv" 15 + end 16 + 17 + set paths "$path"/* 18 + 19 + if set -ql _flag_a 20 + set -a paths "$path"/.* 21 + end 22 + 23 + du -hs $paths | sort -h 24 + 25 + end