lackey
lackey copied to clipboard
Implement Linux PlatformManager
Somewhat easier thanks to the keyboard
library.
A Linux wheel for opencv will also have to be part of this piece.
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.
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.
Am waiting for OSX implementation.
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.
The keyboard
library does not yet have OS-X support. Working on that implementation.
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.
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
Fix opencv install issue : https://github.com/glitchassassin/lackey/issues/78 is close.
Hello glitchassassin, when will it become compatible for linux?Waiting Impatiently:) Kubuntu 16.04 :))
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.
thank you, you do great things.
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..
I'm unable to duplicate this issue, @rwalton00.
Steps to test:
- Open a new Terminal window
- Launch
python
-
from lackey import *
-
type("m", KeyModifier.CMD)
- 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!
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!
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!
Really looking forward to Linux OS support.
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..
This is pretty issue tool. Linux support would be awesome.
tell me please when you can use on linux?
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.
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.
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.
Although mouse movement works, mouse clicking does not appear to work properly in the keyboard
library. More troubleshooting required.
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.
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.
Had a couple stray platform checks, lackey.wait()
is now attached.
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.
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