lackey icon indicating copy to clipboard operation
lackey copied to clipboard

Implement Linux PlatformManager

Open glitchassassin opened this issue 8 years ago • 29 comments

Somewhat easier thanks to the keyboard library.

glitchassassin avatar Jan 19 '17 14:01 glitchassassin

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

glitchassassin avatar Feb 13 '17 19:02 glitchassassin

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 avatar Mar 21 '17 20:03 glitchassassin

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.

glitchassassin avatar Apr 03 '17 17:04 glitchassassin

Am waiting for OSX implementation.

DeChrish avatar Apr 06 '17 19:04 DeChrish

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 avatar May 02 '17 00:05 glitchassassin

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

glitchassassin avatar May 02 '17 01:05 glitchassassin

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 avatar May 23 '17 20:05 glitchassassin

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

glitchassassin avatar Jun 21 '17 14:06 glitchassassin

Fix opencv install issue : https://github.com/glitchassassin/lackey/issues/78 is close.

DeChrish avatar Aug 24 '17 21:08 DeChrish

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

unicornlox avatar Oct 18 '17 00:10 unicornlox

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.

glitchassassin avatar Oct 23 '17 12:10 glitchassassin

thank you, you do great things.

unicornlox avatar Oct 23 '17 23:10 unicornlox

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..

rrwalton avatar Oct 25 '17 21:10 rrwalton

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!

glitchassassin avatar Oct 26 '17 13:10 glitchassassin

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!

rrwalton avatar Oct 26 '17 19:10 rrwalton

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!

sec0p1 avatar Apr 02 '18 15:04 sec0p1

Really looking forward to Linux OS support.

btand avatar May 11 '18 06:05 btand

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..

maxiedaniels avatar Dec 06 '18 06:12 maxiedaniels

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

Lakshmipathi avatar Feb 06 '19 00:02 Lakshmipathi

tell me please when you can use on linux?

astafeev avatar Mar 11 '19 13:03 astafeev

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.

fvertk avatar May 22 '19 22:05 fvertk

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 avatar May 27 '19 23:05 glitchassassin

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 avatar May 28 '19 02:05 glitchassassin

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

glitchassassin avatar May 28 '19 02:05 glitchassassin

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.

fvertk avatar May 28 '19 09:05 fvertk

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.

zadamsr avatar May 29 '19 06:05 zadamsr

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

glitchassassin avatar May 29 '19 22:05 glitchassassin

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.

zadamsr avatar May 30 '19 00:05 zadamsr

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

EmetMet avatar Mar 30 '20 12:03 EmetMet