newmarcel/KeepingYouAwake

Using custom URI scheme without losing focus.

eggpi opened this issue · 2 comments

eggpi commented

Hi, thanks a lot for this tool, it's very handy!

I was trying out the custom URI schemes from #16 for some simple scripting and I noticed that they steal focus from the current application. So, on my OS X Catalina (10.15.5), if I open a Terminal window and do:

$ open keepingyouawake:///activate

KeepingYouAwake activates as expected, and the Terminal window loses focus.

Would it be possible to activate it in the background without stealing focus like that?

bumping this as I just tracked down this super annoying behaviour. I called the URI periodically during the day and it always interrupted my work flow as the active window lost its focus.

Hi! The open application has an additional parameter -g that does not bring the app into the foreground

 -g  Do not bring the application to the foreground.

You can find out more by reading the manual page with the man open command. Hopefully this resolves the problem for you.