Copy share url to clipboard
This commit is contained in:
parent
cbe3554252
commit
ec5692e064
1 changed files with 6 additions and 2 deletions
8
sshare
8
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/"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue