Please don’t rely on this Gitea instance being around forever. If any of your build scripts use my (kageru’s) projects hosted here, check my Github or IEW on Github for encoding projects. If you can’t find what you’re looking for there, tell me to migrate it.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
2.2 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# pyshare
A simple python script that aims to replace the most basic functionalities (TL Note: the ones I used) of ShareX.
This wouldn't be necessary if ShareX had just been developed as a cross-platform project, but I digress.
Needless to say, this is being developed for and tested on Linux. If you're on Windows, just use ShareX.\
~~Only (s)ftp uploads for now~~ I added an option for simple curl commands (like used by 0x0).
#### What works:
- Taking area screenshots
- Uploading screenshots to (s)ftp or to POST APIs via curl
- Uploading files
- Mirroring URLs
- Generating a link from that and putting it into the clipboard
#### What's planned
- polish
- whatever stupid idea I will come up with in the future
### Dependencies
`pysftp`, `pyperclip`, and `PIL` which can be installed via pip:
```
$ pip install pysftp pyperclip pillow
```
as well as `maim` (https://github.com/naelstrof/maim) and `notify-send` which should be available in your favorite package manager
(or pre-installed, depending on your distribution and desktop environment).
### Usage
Change all the relevant variables in `config.py` and execute
```
$ python3 pyshare
```
to take a screenshot and upload it.
Depending on your window manager, you can bind this to a hotkey. To cancel the capture, simply right-click.
The script will then, uh, terminate (which is fancy speak for crash because it really doesn't matter).
You can also use the script to upload local files, mirror websites, or share your clipboard. Simply execute
```
$ python3 pyshare -m text
```
This will automatically choose an action based on the contents of your clipboard. Links will be downloaded and mirrored, local paths will be uploaded, and other strings will be uploaded as text files to the remote host.
Afterwards, the link is automatically copied to clipboard.
To upload one or multiple files, just list them like this:
```
$ python3 pyshare -f file1 file2 file3
```
You will then see a list of all URLs in your terminal. The links will also appear in a notification, and they will be copied to the clipboard as soon as the upload is completed, however, this is probably not very useful because they will be overwritten by the next files URL soon thereafter.