goldwarden/ui/clipboard.py

9 lines
271 B
Python
Raw Normal View History

2023-12-23 09:18:30 +03:00
import subprocess
2023-12-26 18:32:11 +03:00
import os
2023-12-23 09:18:30 +03:00
def write(text):
2023-12-26 18:32:11 +03:00
# set path
env = os.environ.copy()
env["PATH"] = env["PATH"] + ":/app/bin"
process = subprocess.Popen(["/bin/sh", "-c", "wl-copy"], stdin=subprocess.PIPE, env=env)
2023-12-23 09:18:30 +03:00
process.communicate(text.encode('utf-8'))