Skip to content

Instantly share code, notes, and snippets.

@tuxarch
Forked from tadly/rofi-gpaste.sh
Created November 26, 2017 17:32
Show Gist options
  • Select an option

  • Save tuxarch/8bd8cd0a4c3fa6c05391a5ed7e1e3107 to your computer and use it in GitHub Desktop.

Select an option

Save tuxarch/8bd8cd0a4c3fa6c05391a5ed7e1e3107 to your computer and use it in GitHub Desktop.
rofi + gpaste
#!/usr/bin/env bash
#
# Use rofi to select an entry from gpaste
#
# Requirements:
# rofi, gpaste
#
line=`gpaste-client --oneline | rofi -dmenu -i -p gpaste: $@`
index=`echo $line | cut -d ':' -f1`
if ! [[ $index =~ ^[0-9]+$ ]]; then
exit 0
fi
gpaste-client select $index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment