Copy share url to clipboard

This commit is contained in:
Gnarwhal 2024-07-31 15:41:13 +00:00
parent cbe3554252
commit ec5692e064
Signed by: Gnarwhal
GPG key ID: 0989A73D8C421174

8
sshare
View file

@ -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/"