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

Add app/window/screen events #72

Closed
12 tasks
thesoftwarephilosopher opened this issue Jun 26, 2014 · 44 comments
Closed
12 tasks

Add app/window/screen events #72

thesoftwarephilosopher opened this issue Jun 26, 2014 · 44 comments
Assignees
Milestone

Comments

@thesoftwarephilosopher
Copy link
Contributor

App events:

  • AppLaunched
  • AppTerminated
  • AppHidden
  • AppShown

Window events:

  • WindowCreated
  • WindowClosed
  • WindowMoved
  • WindowResized
  • WindowMinimized
  • WindowUnminimized
  • WindowFocused

Screen events:

  • ScreenLayoutChanged (i.e. screen may have been added/removed)
@thesoftwarephilosopher

This comment was marked as resolved.

@thesoftwarephilosopher thesoftwarephilosopher modified the milestone: 1.0 Jun 28, 2014
@thesoftwarephilosopher

This comment was marked as resolved.

@thesoftwarephilosopher thesoftwarephilosopher changed the title Add app/window events Add app/window/screen events Jul 1, 2014
@thesoftwarephilosopher thesoftwarephilosopher added this to the 1.1 milestone Jul 1, 2014
@creese
Copy link

creese commented Jul 4, 2014

With just WindowCreated and WindowClosed, we should be able to create a nice one-workspace clone of http://xmonad.org.

@flaub
Copy link

flaub commented Jul 7, 2014

+1

@thesoftwarephilosopher

This comment was marked as resolved.

@thesoftwarephilosopher

This comment was marked as resolved.

@thesoftwarephilosopher

This comment was marked as resolved.

@mengelbrecht
Copy link

Is there already an API to use to get notified of launched Applications?

@thesoftwarephilosopher

This comment was marked as resolved.

@mengelbrecht
Copy link

Nice! Looking forward to it :-).

@thesoftwarephilosopher

This comment was marked as resolved.

@thesoftwarephilosopher thesoftwarephilosopher modified the milestones: 1.1, 2.0 Jul 24, 2014
@thesoftwarephilosopher
Copy link
Contributor Author

I've got a better idea of how to implement this now.

@thesoftwarephilosopher
Copy link
Contributor Author

Working on this now.

@thesoftwarephilosopher
Copy link
Contributor Author

Thinking of making this a generic module like listener to reduce code duplication. Then all the events would be listed in tables in their relevant module, like listener.new(application.event.launched, function()...end):start()

@thesoftwarephilosopher
Copy link
Contributor Author

I need to do this on a night when I have a fresh mind and no distractions. Tonight I had neither. :/

@iakshay
Copy link

iakshay commented Jul 27, 2014

Would be great, if we can get these events – https://github.com/jigish/slate/wiki/Events

How about some thing like Event.on(application.event.launched, function() end)

Maybe battery.watcher could also be integrated into this module.

@muescha
Copy link
Contributor

muescha commented Jul 28, 2014

add key pressed/key released events

benefit:

@thesoftwarephilosopher
Copy link
Contributor Author

@muescha That was done in eventtap which is coming in 1.1

@muescha
Copy link
Contributor

muescha commented Jul 28, 2014

i would prefer the @iakshay syntax Event.on over an eventtap naming.

@thesoftwarephilosopher
Copy link
Contributor Author

@muescha For input events, the eventtap module is pretty much set in stone at this point. This issue is for other events, which need more thought.

@muescha
Copy link
Contributor

muescha commented Jul 28, 2014

but then it looks more consistent if it have always the same syntax and fits your idea for making a generic module for listener (or Event)

@thesoftwarephilosopher
Copy link
Contributor Author

Moving to mjolnir-io/ext#14.

@nathankot
Copy link

this would be the final piece of the puzzle for https://github.com/nathankot/mjolnir.tiling 😄 although can't seem to find mjolnir-io/ext ??

@tmandry
Copy link

tmandry commented Dec 6, 2014

+1, @sdegutis can you link to the issue?

@iakshay
Copy link

iakshay commented Dec 15, 2014

+1 for events

@szymonkaliski
Copy link

Yeah, I'd love that too, shouldn't we reopen this?

@maxrothman
Copy link

@sdegutis 👍 as well, also can't find mjolnir-io/ext.

@thesoftwarephilosopher
Copy link
Contributor Author

I'm currently working on events.

@nathankot
Copy link

@sdegutis thanks for the update 😄

@svalaskevicius
Copy link

awesome! looking forward for event driven tiling WM on osx :) (in fact, the only thing keeping me from using osx is not having xmonad there)

@nathankot
Copy link

@svalaskevicius I hope we convert you eventually 😛

@svalaskevicius
Copy link

@nathankot thanks :)
just to check - is the current implementation of tiling plugin working already or is it blocked by this issue.. and is there maybe a screencast of it in action? I've tried looking for it but couldn't find any.
(should I have asked this elsewhere?)

@nathankot
Copy link

@svalaskevicius yep it works, but doesn't respond to new windows being added (so you'll have to re-tile manually), the tiling project is young so don't think there are videos out in the wild but could do one of my workflow if you want?

@svalaskevicius
Copy link

it would be definitely interesting to see! - it's usually one of the first things I look for when I hear of a new tiling WM :)

@creese
Copy link

creese commented Feb 1, 2015

@nathankot The last time I checked, the tiling project did not work for multiple monitors. Has that issue been addressed?

@nathankot
Copy link

@creese don't use multiple screens myself but this may have fixed it: nathankot/mjolnir.tiling#9 , if not , please make a new issue at mjolnir.tiling ;)

@simichaels
Copy link

Any progress on event handling so far?

@thesoftwarephilosopher
Copy link
Contributor Author

They're basically finished in the Swift window manager I was writing. Main problem is there's no UI in that one yet.

@szymonkaliski
Copy link

Hmmm, but is everything else working? I for one don't need a UI to use it... Is it mjolnir compatible? I'd love to use some modules we already have...

@thesoftwarephilosopher
Copy link
Contributor Author

@szymonkaliski It's all working, but I haven't finished porting all the functions (it's so tedious). It's probably already Mjolnir-compatible, but if not, it could easily be made to be so. I have two versions: one that uses Lua very similarly to Hammerspoon (a Mjolnir fork), and one that's meant to be one you write in pure Swift (in Xcode), and compile into an app that you can run. Since the work was split in two repos, each repo might have an API function or two that the other doesn't, so I'm not entirely which has what. Anyway, I plan to spend an hour or so today cleaning that up and making both repos presentable, and writing down the current status of each in their own READMEs. There'll likely still be some work needed to port some API functions over from Mjolnir, and if that's the case, I'd love some help.

@thesoftwarephilosopher
Copy link
Contributor Author

Oh right, I remember what I planned for the Swift-only version: it would be a framework that you could just import, and you'd just make a new Swift app that embeds and links to this framework, and uses it in applicationDidFinishLaunching. That way, everyone could re-contribute to the framework itself, while keeping their "config" (i.e. the program putting the framework to good use) separate.

@thesoftwarephilosopher
Copy link
Contributor Author

@szymonkaliski turned it into a framework at https://github.com/sdegutis/WindowManager fwiw

@cmsj
Copy link
Contributor

cmsj commented Apr 26, 2015

FWIW, I expect that the Hammerspoon modules for app/window/screen events would port over pretty easily. The code is at:

app events: https://github.com/Hammerspoon/hammerspoon/blob/master/extensions/application/watcher.m
window events: https://github.com/Hammerspoon/hammerspoon/tree/master/extensions/uielement
screen events: https://github.com/Hammerspoon/hammerspoon/blob/master/extensions/screen/watcher.m

(some of this stuff was inherited from Mjolnir's various modules anyway, so it may not all need to be ported over :)

@szymonkaliski
Copy link

@sdegutis https://github.com/sdegutis/WindowManager looks very cool, I hope I'll have some time to play with it soon!

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

No branches or pull requests