Compare commits
3 commits
7130c07100
...
09f26845a0
Author | SHA1 | Date | |
---|---|---|---|
09f26845a0 | |||
ec5692e064 | |||
cbe3554252 |
2 changed files with 28 additions and 3 deletions
19
README.md
19
README.md
|
@ -2,3 +2,22 @@
|
|||
|
||||
Convenience script for uploading files to a server via ssh
|
||||
|
||||
### Hmmm
|
||||
|
||||
Apparently GNOME 42 screenshot utility is called via dbus
|
||||
|
||||
```
|
||||
gdbus call
|
||||
--session
|
||||
--dest org.gnome.Shell
|
||||
--object-path /org/gnome/Shell
|
||||
--method org.gnome.Shell.Eval 'Main.screenshotUI.open()'
|
||||
````
|
||||
but it cannot be called unless `global.context.unsafe_mode = false`
|
||||
is set in gnome shell...which is unideal.
|
||||
|
||||
Ideally there would be a way to launch a desired screenshot (or other generative)
|
||||
before running sshare, and for everything that isn't GNOME 42 screenshot it
|
||||
wouldn't be too hard. But unfortunately I want to use GNOME 42 screenshot ;-;
|
||||
What to do...
|
||||
|
||||
|
|
12
sshare
12
sshare
|
@ -3,18 +3,24 @@
|
|||
import getpass
|
||||
import importlib.util
|
||||
import os
|
||||
import pyclip
|
||||
import time
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
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",
|
||||
"-r",
|
||||
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}",
|
||||
f"{config.ssh_user}@{config.ssh_target}:{config.ssh_dir}/{file_name}",
|
||||
])
|
||||
|
||||
|
||||
|
@ -22,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