Last active
May 16, 2022 07:17
-
-
Save tadly/2d5fc5879216382acec8c09d09b6fa61 to your computer and use it in GitHub Desktop.
rofi + gpaste
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Use rofi to select an entry from gpaste | |
# | |
# Requirements: | |
# rofi, gpaste | |
# | |
line=`gpaste-client --oneline | \ | |
rofi -dmenu -i -p gpaste -kb-custom-1 Ctrl+x $@` | |
exit_code=$? | |
index=`echo $line | cut -d ':' -f1` | |
if ! [[ $index =~ ^[0-9]+$ ]]; then | |
exit 0 | |
fi | |
if [ $exit_code == 0 ]; then | |
gpaste-client select $index | |
elif [ $exit_code == 10 ]; then | |
gpaste-client delete $index | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want me to change something, or have question, make sure to ping me directly (use @tadly) as otherwise I won't get a notification for your comment ;)