Dual monitors in Sikuli - sikuli

I'm using Sikuli (sikulixapi-1.1.0).
I have 2 monitors. When I use my primary monitor, everything is ok. When I also use the second monitor, it does not work.
I make a screenshot on the second monitor and I wrote this:
Screen s = new Screen(1);
Error
Possible cause in case you did not touch the mouse while script was
running: Mouse actions are blocked generally or by the frontmost
application. You might try to run the SikuliX stuff as admin.

You seem to be having issues with the multimoitor setup.
A similar question was asked on launchpad and can be found here:
https://answers.launchpad.net/sikuli/+question/295379
The basic advice was "Make sure you are using the latest version of 1.1.1 in your java context"

Related

Using PhantomJS, Electron, NWJS or AppJS as a wallpaper engine for Mac OS X, Linux and Windows

I have recently discovered the Mac OS X application GeekTool where one can use a html file as your wallpaper. However that isnt the most interesting thing, what I find interesting about it is that it keeps the html file alive even allowing http requests. I wanted to create that using Node.js and some other web technology that allows to run a browser on the desktop with full access to nodejs' APIs.
So I wondered if there is any way to create an alive browser in the background (as a wallpaper), which is interactive (e.g. I can press buttons and type in inputs). If so, where can read about that?
I prefer either one of the packages mentioned above, but others are accepted as well. What I need it to do is just being under the desktop-icons but as well over the default wallpaper, so it can be interactive.
Thanks 😀

How to test mobile chrome's "save to homescreen" prompt

I'm resurrecting an old project of mine as a way to learn some new stuff.
I'm doing this code lab from IO Add Your Web App to a User's Home Screen.
Is there any way, other than connecting a phone and waiting a lot, to test if users will be shown the prompt below?
I've tested it with Lighthouse and all tests come back green, but I've never seen the prompt. It feels very random at the moment.
The answer to This question puts the stuggle into perspective:
The user has visited your site twice over two separate days during the course of two weeks
Does that mean I need to wait 2 days between changes to see if it worked?
Enable chrome://flags/#bypass-app-banner-engagement-checks and you will see the banner as long as you have a manifest (configured correctly) and are on HTTPS and have a service worker.
Increasing Engagement with Web App Install Banners
anshulix has correctly answered the question, but I thought I'd put in a more verbose answer.
To remove the waiting and other requirements for the save to homescreen prompt, then you need to enable a flag.
Enable chrome://flags/#bypass-app-banner-engagement-checks and you will see the banner as long as you have a manifest (configured correctly) and are on HTTPS and have a service worker.
Which comes from Increasing Engagement with Web App Install Banners
It's important to remember that you are setting this flag on the mobile browser, not on your desktop browser. For some reason this didn't occur to be for a while!
You also need to restart mobile Chrome for the flag to take effect. If you've got your tabs mixed in with your other apps, this can be tricky because you need to hunt down all the tabs and close them. (Or find a better way to close Chrome.)
I found it much easier to do this debugging in Chrome Dev, rather than regular chrome because a) I know it's got the latest fixes in it, and b) because I only have 1 tab open, so it's easy to restart the browser.
If you are doing remote inspection, there is an issue about the messages that come up in the console. In Chrome 50 you get:
App banner not shown: could not determine the best icon to use
This doesn't seem to be true; in more recent builds—e.g. mobile Chrome 52—save to desktop works just fine. It's a disconcerting but useless error.
As a bonus helpful thing, realfavicongenerator does an excellent job of generating all the icons and the manifest file that you need.

How can I tell if a Chrome app is already running

I'm looking for means of telling whether other instances of a Chrome app are already running but Chrome's excellent context isolation makes it quite difficult.
Also, I was hoping chrome.runtime APIs would help but it doesn't seem to be the case.
Essentially, I want to make sure only one instance can run at any given time.
Thanks!
Your background page can store global state that lets you keep track of which windows have been launched by the app.
Your app can only have one background (or event) page at a time.
If you are wanting to prevent multiple windows from launching, make sure your chrome.app.window.create call has an "id" option. That means only one window will be created with that given id.

How to disable screen saver in WinRT

This is how you do it on Windows Phone 7 http://blog.jerrynixon.com/2011/11/mango-sample-lock-and-run.html is it possible in Windows 8?
This sample is showing you how to implement the functionality so your app will still "run" when the device is locked. It only seems to work with a kind of "background tasks" which makes it not exactly the same as it is for Windows Phone.
http://code.msdn.microsoft.com/windowsapps/Lock-screen-apps-sample-9843dc3a
Please note that an app that can run when the device is locked should have at least one of the following background tasks:
Control Channel
Timer
Push Notification
Here is some more info on the lockscreen: http://msdn.microsoft.com/library/windows/apps/Hh779720
UPDATE:
As far as I have found there is no exact behaviour like in Windows phone to run your app under the lockscreen. There are a few recent posts on the MSDN blogs which explain the background model http://blogs.msdn.com/b/windowsappdev/archive/2012/05/16/being-productive-when-your-app-is-offscreen.aspx?wa=wsignin1.0
Sorry to see that at this moment there is no way to make it work under the lockscreen

Win32: Is it possible to build an app that houses other apps?

I was wondering, how would you go about writing an application that basically houses other applications inside of it?
The reason I ask is that I'd love to build an app that 'conquers' my current explosion of open windows. I've used virtual window managers before and they're nice and all, but I could do so many things with an app like I mention.
Alternatively does anyone know of an easy to use/intuitive application for confining windows to 'regions' of your screen? Something like GridMove, but more intuitive and less flakey?
You could create a window, then you could enumerate all Windows that have the style WS_OVERLAPPEDWINDOW, select the ones belonging to the application you want to house, then call SetParent on the window, setting the parent to the window you created. You could also use FindWindow to find a window by its title.
All the windows inside the house can never leave the house window's boundaries, but they still follow all the same rules. You can still click-and-drag windows etc.
The problem here is that if the application inside the house creates another window, its parent will most likely be the desktop window, not the house window.
I think what you are describing is generally called a Window Manager. The Windows shell is itself a (poor) example of a window manager. You might want to investigate some alternatives. I know there has been some success in getting KDE ported to Windows, so you might want to look at the current state of that project.
Microsoft also provides a PowerToy (IIRC) that gives you virtual desktop support, but it's really bad. Have you considered just getting a second monitor (and perhaps a utility such as MultiMon Taskbar to get a second task bar on the other monitor)?
Here is code that uses FindWindow / SetParent to create a tabbed view combining different applications Jedi Window Dock
I also wrote an application (not free, not open source) that takes this idea a bit further called WindowTabs.
The only caution I would give you is that not all applications like being parented. If your writing .NET, there are some "Gotcha's" there (which is why WindowTabs doesn't use parenting).
Also, in general, once you do a SetParent, you are joining the threads at a Win32 level meaning that if one hangs, all of them are toast.
Multiple Document Interfaces could help you out.
Despite the multiple down votes, I stand by this answer because the OP never stated the source of the "explosion of windows." I've seen business apps that open several windows at a time (or users that would open several instances "to save time") where MDI would've been a nice feature for them.
If the OP is a power user who has a need for another window manager because he runs many apps at once, then this really doesn't apply. It also isn't the problem I'd be addressing -- it would be finding a way to have fewer windows.
In general, there's always a VM.
It may be overkill or it may not work depending on the specifics of what you're trying to do. But VMWare will let you copy/paste files and text between your VM and local machine, so it's not that far off of being a true window manager. The system requirements aren't even that outrageous, considering how much memory iTunes + a typical browser eat up.