From ec5692e0643e49a1519ce85f1a5e7a94bdec5d3a Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Wed, 31 Jul 2024 15:41:13 +0000 Subject: [PATCH] Copy share url to clipboard --- sshare | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sshare b/sshare index 8236ff0..b3a3609 100755 --- a/sshare +++ b/sshare @@ -3,6 +3,7 @@ import getpass import importlib.util import os +import pyclip import time import subprocess import sys @@ -11,12 +12,15 @@ def main(): config = Config() id = time.time_ns() + file_name = f"{id}.png" + + pyclip.copy(f"https://{config.ssh_target}/sshare/{file_name}") subprocess.run([ "scp", f"-P {config.ssh_port}", f"/home/gnarwhal/Pictures/Screenshots/Screenshot from 2024-07-31 06-34-57.png", - f"{config.ssh_user}@{config.ssh_domain}:{config.ssh_dir}/{id}.png", + f"{config.ssh_user}@{config.ssh_target}:{config.ssh_dir}/{file_name}", ]) @@ -24,7 +28,7 @@ class Config: def __init__(self): self.ssh_port = 2222 self.ssh_user = getpass.getuser() - self.ssh_domain = "monodon.me" + self.ssh_target = "monodon.me" self.ssh_dir = "~/sshare/"