Skip to content

Instantly share code, notes, and snippets.

@cirrusUK
Created March 25, 2021 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cirrusUK/7be91fc5a974783a0a332155b2ae0fa0 to your computer and use it in GitHub Desktop.
Save cirrusUK/7be91fc5a974783a0a332155b2ae0fa0 to your computer and use it in GitHub Desktop.
use fzf to list chunk.io uploads
#!/bin/zsh
export DISPLAY=":0"
export XDG_RUNTIME_DIR=/run/user/$(id -u)
id=$(curl -ns https://chunk.io/cirrus | sed 's/http/https/g' )
IFS=$'\n'
out=("$(curl -ns https://chunk.io/cirrus | sed 's/http/https/g' | fzf -m --color dark,hl:172,hl+:46,fg+:46,bg+:235 --color info:150,prompt:46,spinner:150,pointer:46,marker:7,border:46 --border=sharp --prompt='➤ ' --pointer='➤ ' --marker='➤' --height 60% --expect=ctrl-o,ctrl-e | cut -d" " -f1 )")
key=$(head -1 <<< "$out")
file=$(head -2 <<< "$out" | tail -1)
if [ -n "$file" ]
then
[ "$key" = ctrl-o ] && ${BROWSER} "$file" || ${BROWSER} "$file"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment