-
-
Save strix/3a81adefe84d5df1b08068cb5ed86477 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 -theme Monokai -dmenu -i -p clipboard -kb-custom-1 Ctrl+x $@` | |
| exit_code=$? | |
| index=`echo $line | cut -d ':' -f1` | |
| if ! [[ $index =~ ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ ]]; 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