Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux Feedback #3

Closed
sinanislekdemir opened this issue Jun 16, 2021 · 7 comments
Closed

Linux Feedback #3

sinanislekdemir opened this issue Jun 16, 2021 · 7 comments

Comments

@sinanislekdemir
Copy link

Hi mate! @caglartoklu
Awesome work;

Here is a little feedback from Pop Os (debian based) 20.10

  1. tkinter is not installed by default, so users need to ensure that they have installed tk through sudo apt-get install python3-tk
  2. setup.py is missing pyperclip package which leads to this:
$ shotlast                                                                                                                                                                              [10:24:13]
Traceback (most recent call last):
  File "/home/sinan/.virtualenvs/caglar/bin/shotlast", line 5, in <module>
    from shotlast import main
  File "/home/sinan/.virtualenvs/caglar/lib/python3.8/site-packages/shotlast/__init__.py", line 29, in <module>
    import shotlastmain  # pylint: disable=C0413, E0401
  File "/home/sinan/.virtualenvs/caglar/lib/python3.8/site-packages/shotlast/shotlastmain.py", line 31, in <module>
    import pyperclip
ModuleNotFoundError: No module named 'pyperclip'
  1. pyperclip grabclipboard does not work for Linux;
NotImplementedError('ImageGrab.grabclipboard() is macOS and Windows only')
PyperclipException('\n    Pyperclip could not find a copy/paste mechanism for your system.\n    For more information, please visit https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error ')
@caglartoklu
Copy link
Owner

Hi @sinanislekdemir ,
Thank you for your very detailed feedback.

  1. tkinter is not installed by default, so users need to ensure that they have installed tk through sudo apt-get install python3-tk

I will make sure that this is mentioned in the installation section of the README file.
Tkinter is actually used by PySimpleGUI.

  1. setup.py is missing pyperclip package which leads to this:

My bad, thanks for pointing it out. I will add this dependency.

  1. pyperclip grabclipboard does not work for Linux;

Followed the link in the error message, pyperclip documentation says that there are ways to provide some mechanisms for Linux derivatives.

I will again make sure to mention this in installation section.

After all of these, I will make a full test on Ubuntu 20.04 LTS.

Again, thanks for all the resourceful feedback and error messages.

@caglartoklu
Copy link
Owner

Hi @sinanislekdemir ,

I just had a test on Ubuntu 20.04 LTS.

Here is what I did after a fresh install:

sudo apt install python3-pip
sudo apt install git
sudo apt-get install python3-tk
sudo apt-get install xclip

pip3 install git+https://github.com/caglartoklu/shotlast

# add to PATH variable:
vi .bashrc
source .bashrc

shotlast

Unfortunately, I got another error message (screenshot below).

This is not about pyperclip, but Pillow itself.
Its documentation clearly states that PIL.ImageGrab.grabclipboard() is only supported on Windows and macOS.

I will see what I can do about it.

clip_20210617_015128

@sinanislekdemir
Copy link
Author

Hi @caglartoklu ;

I can consider this ticket as done and closing it 👍

Awesome project tho. I'll keep an eye on it. I'd like to see it work on linux at some time in the future.
Take care!

@caglartoklu
Copy link
Owner

Hi @sinanislekdemir ,

Thank you very much for all your interest.
I am determined to find a way to support Linux.
Maybe I will separate clipboard handling for different operating systems, so Pillow support for Linux will not be an issue.
I will inform you when it is done.

Bye, take care.

@caglartoklu
Copy link
Owner

Hi @sinanislekdemir ,

I have added Linux support with commit #dcfa05e
I have tested myself on Ubuntu 20.04 LTS, switched from text to images and back, and it worked fine.
On Linux, text, and images are supported, but not files (yet.)

I have re-written image saving code, now it definitely needs xclip.
Except shotlast itself and its python package dependencies, the requirements for Debian derivatives are as follows:

sudo apt-get install python3-tk
sudo apt-get install xclip

I would be very happy if you could test it sometime.
Whenever you could spare some time.
Thanks in advance.

Çağlar

@sinanislekdemir
Copy link
Author

Hi @caglartoklu apologies;
Due to some bad UX design change in github, I just noticed the mention.
I just tested and can confirm that the latest main branch works without any issues under:

Distributor ID:	Pop
Description:	Pop!_OS 20.10
Release:	20.10
Codename:	groovy

which is awesome 😍 I'd be supper happy to see this project to be available in pypi as well!

@caglartoklu
Copy link
Owner

Hi @sinanislekdemir ,
Thank you very much for the test, great to hear the positive results. : )
This weekend, I will make an RPM based distro test (I have latest CentOS or Rocky Linux in my mind).
If that goes well, this package will so go to pypi : )
Thanks, take care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants