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

Implement Linux PlatformManager #56

Open
glitchassassin opened this issue Jan 19, 2017 · 29 comments
Open

Implement Linux PlatformManager #56

glitchassassin opened this issue Jan 19, 2017 · 29 comments

Comments

@glitchassassin
Copy link
Owner

Somewhat easier thanks to the keyboard library.

@glitchassassin
Copy link
Owner Author

A Linux wheel for opencv will also have to be part of this piece.

@glitchassassin
Copy link
Owner Author

I'm anticipating a new computer shortly, so I'll be working on cross-platform support in OS X and Linux in the near future.

@glitchassassin glitchassassin changed the title Implement Linux PlatformManager Implement Linux and OS X PlatformManagers Apr 3, 2017
@glitchassassin
Copy link
Owner Author

Initial research on Linux seems to indicate that getting a robust screen capture from native libraries without a third-party tool is difficult. Working to find the best solution.

@DeChrish
Copy link

DeChrish commented Apr 6, 2017

Am waiting for OSX implementation.

@glitchassassin
Copy link
Owner Author

Ran into an issue installing opencv on OSX. Installing it as an ordinary user failed; it had to be installed using sudo:

sudo -H pip3 install opencv-python

I've opened an issue on the opencv-python repository. Hopefully this can be fixed before we roll out OS X support.

@glitchassassin
Copy link
Owner Author

The keyboard library does not yet have OS-X support. Working on that implementation.

@glitchassassin
Copy link
Owner Author

The OS X branches of both keyboard and lackey are nearly complete, pending a bit more testing.

Retina displays are a pain to work with. Most notably, OS X's default screencap functionality saves PNGs as double the resolution and double the DPI, and this means the images must be edited down before being usable. I am going to experiment with auto-scaling loaded images to 72 DPI.

@glitchassassin
Copy link
Owner Author

I have submitted a pull request to merge the OS X fork of keyboard with the main release.

Still to do for lackey:

  • ◻️ Test auto-scaling of loaded images
  • ◻️ Fix opencv install issue

@DeChrish
Copy link

DeChrish commented Aug 24, 2017

Fix opencv install issue : #78 is close.

@unicornlox
Copy link

Hello glitchassassin,
when will it become compatible for linux?Waiting Impatiently:)
Kubuntu 16.04 :))

@glitchassassin
Copy link
Owner Author

I have been buried by other projects, but at the moment I'm working on the automated Travis build for the Mac OS version. Once that's complete, I'll try to turn my attention to the Linux implementation.

@unicornlox
Copy link

thank you, you do great things.

@rrwalton
Copy link

thanks, great work. having a small issue: Key.CMD on mac returns an error when used with type() as its mapped to the 'windows' key..

@glitchassassin
Copy link
Owner Author

I'm unable to duplicate this issue, @rwalton00.

Steps to test:

  1. Open a new Terminal window
  2. Launch python
  3. from lackey import *
  4. type("m", KeyModifier.CMD)
  5. Expected result: The terminal window is minimized.

Neither Key.CMD nor KeyModifier.CMD throws an error for me.

If you're able to reliably duplicate the problem, please open a new issue with the steps you take and I'll dig further.

Thanks!

@rrwalton
Copy link

Hi @glitchassassin ,

I'm reproducing this problem consistently. I installed lackey 0.7.0 using pip and I'm running MacOS 10.12.6, but I have also seen the problem on 10.11.6.

My reproduction steps are essentially identical to yours posted above, so I'm assuming this is an environmental issue on my end. I've logged a new ticket with more detail.

Thanks again for the API and for implementing MacOS support!

@glitchassassin glitchassassin changed the title Implement Linux and OS X PlatformManagers Implement Linux PlatformManager Dec 27, 2017
@sec0p1
Copy link

sec0p1 commented Apr 2, 2018

Hi! First of all I want to say that I really like your work a lot!

My question is, when will lackey be available for Linux?
Thanks!

@btand
Copy link

btand commented May 11, 2018

Really looking forward to Linux OS support.

@maxiedaniels
Copy link

Any update on Linux support? I have a project using lackey that I need to run on Linux and just realized today that it's not supported..

@Lakshmipathi
Copy link

This is pretty issue tool. Linux support would be awesome.

@astafeev
Copy link

astafeev commented Mar 11, 2019

tell me please when you can use on linux?

@fvertk
Copy link

fvertk commented May 22, 2019

Ignore my previous comment, I can see that some work has been done in trying to implement this. I may see where work remains and try to help if I can.

@glitchassassin
Copy link
Owner Author

Making some progress on this at long last! I have deciphered enough python-xlib to collect monitor arrangement and screen resolution, assuming we can get details from Xinerama; if not, right now, we just treat the whole array as a single screen and hope for the best. I am not going to botch my Linux install by trying to disable Xinerama to test, not yet!

We have screencapture functionality via Xlib as well. Working on the window management routines at the moment.

@glitchassassin
Copy link
Owner Author

Finished the rest of the draft and updated the feature-linux branch from the develop branch. I've done some basic testing to make sure it imports correctly, detects the screens, and correctly moves the mouse to hover in the center of each of my monitors. I'll update the automated test cases to cover Linux as well and then we'll be ready to push this out.

@glitchassassin
Copy link
Owner Author

Although mouse movement works, mouse clicking does not appear to work properly in the keyboard library. More troubleshooting required.

@fvertk
Copy link

fvertk commented May 28, 2019

Fantastic news. I started looking through the PlatformManager classes, but you're certainly faster than me with your own code! I'll test things out.

@zadamsr
Copy link

zadamsr commented May 29, 2019

First attempt of running my code against Linux got past the previous hurdles. But now it gets an error with the "wait" method:

import lackey
lackey.wait("4352.png",90)

AttributeError: module 'lackey' has no attribute 'wait'

Not sure if it's just on my end, but the same code runs well in MacOS. I'll keep testing things.

@glitchassassin
Copy link
Owner Author

Had a couple stray platform checks, lackey.wait() is now attached.

@zadamsr
Copy link

zadamsr commented May 30, 2019

Nice, that worked this time. Now the one part my test failed on is the same spot you commented on above: when clicking, mouse hovers over matched image and doesn't click.

@EmetMet
Copy link

EmetMet commented Mar 30, 2020

Hi @glitchassassin !
Found problem with a click()
Trying small tests on Ubuntu 18
Lackey 0.7.3 found button, moved mouse, but does not click, after this script stops, because next step necessary button appears only after clicking

Using Lackey on this step like: click(Pattern("Pic_button.png"))

Any opinions on this issue
Maybe I'm using this incorrectly
Or are there other uses

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

No branches or pull requests