Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #!/bin/bash
  2. case $ALBERT_OP in
  3. "METADATA")
  4. STDOUT='{
  5. "iid":"org.albert.extension.external/v2.0",
  6. "name":"Goldendict",
  7. "version":"1.0",
  8. "author":"Manuel Schneider",
  9. "dependencies":["goldendict"],
  10. "trigger":"gd "
  11. }'
  12. echo -n "${STDOUT}"
  13. exit 0
  14. ;;
  15. "INITIALIZE")
  16. if hash goldendict 2>/dev/null; then
  17. exit 0
  18. else
  19. exit 1
  20. fi
  21. echo -n "{}"
  22. ;;
  23. "QUERY")
  24. QUERYSTRING="${ALBERT_QUERY:3}"
  25. echo -n '{
  26. "items":[{
  27. "id":"goldendict",
  28. "name":"Use goldendict to lookup '"'${QUERYSTRING}'"'",
  29. "description":"Opens the scan popup and searches for '"'${QUERYSTRING}'"'.",
  30. "icon":"goldendict",
  31. "actions":[{
  32. "name":"goldendict",
  33. "command":"goldendict",
  34. "arguments":["'${QUERYSTRING}'"]
  35. }]
  36. }]
  37. }'
  38. exit 0
  39. ;;
  40. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement