Skip to content

Instantly share code, notes, and snippets.

@tyjak
Last active August 1, 2021 12:05
Show Gist options
  • Save tyjak/380fd753428f36a05bbdb06051c1cb17 to your computer and use it in GitHub Desktop.
Save tyjak/380fd753428f36a05bbdb06051c1cb17 to your computer and use it in GitHub Desktop.
clip/i3/dmenu-gist
#!/bin/sh
# Dmenu for gist clip for i3
# Look to the description of the gist that star with "clip/" and get output to clipboard ready to paste
# depends on : gist, dmenu
# GistID: 380fd753428f36a05bbdb06051c1cb17
gist_menu=$(gist -l | grep "clip/" | sed 's@.*clip/@@' | sort | dmenu -p "Clips:" -l 10 -i -nb '#b58900' -nf '#eee8d5' -sb '#002b24' -fn 'MesloLGSDZ Nerd Font-10' -h ${DMENUHEIGHT:-36})
gist_target=$(gist -l | grep "clip/$gist_menu" | awk '{print $1}' | cut -d"/" -f4)
[ ! -z "$gist_target" ] && gist -r $gist_target | xclip -i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment