Skip to content

Instantly share code, notes, and snippets.

@negasus
Created June 16, 2021 11:06
Show Gist options
  • Save negasus/d4ef9037ecdb9a4e1e54d5744b54c1df to your computer and use it in GitHub Desktop.
Save negasus/d4ef9037ecdb9a4e1e54d5744b54c1df to your computer and use it in GitHub Desktop.
Raycast scrtipt for UUID generation
#!/usr/bin/env python3
# @raycast.schemaVersion 1
# @raycast.title uuid
# @raycast.mode inline
# @raycast.author negasus
# @raycast.authorURL https://negasus.dev
# @raycast.description Generate UUIDv4 and copy it to the clipboard
import sys
import uuid
import subprocess
result = str(uuid.uuid4())
subprocess.run("pbcopy", universal_newlines=True, input=result)
hint = "uuid copied to the clipboard"
if sys.stdout.isatty():
print(hint)
else:
sys.stdout.write(hint)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment