Writing an extension



Hi everybody.

I'm looking for help trying to write an extension which moves a window
to a specific workspace when it is open. I am using as a base the
extension posted by Thomas Bouffon in

http://mail.gnome.org/archives/gnome-shell-list/2010-November/msg00036.html

This extension however moves every window when a new one opens. In
particular, the extension calls a function when a window is open with

display.connect('window-created',FindAndMove);

I would like to ask if it is possible to perform an action ONLY on the
new window that is opened, something like (this is a theoretical guess,
hope you get the point):

display.connect('window-created',FindAndMove(opened_window));

where ideally opened_window is something with the proprieties of
get_meta_window()

Furthermore, I'd like to ask if there is a way to know how many
workspaces are open when the new window is created, so I do not have to
cycle as done in the extension, which goes like

for ( let j = global.screen.n_workspaces; j <=
workspace_where_i_want_to_open_app ; j++ ) {
	global.screen.append_new_workspace(false,0);
}

Finally, is there any documentation listing objects and methods for
things like global, get_window_actors, etc. or do I have to rely on
Looking Glass?

I am completely unfamiliar with JS and I am trying to learn, so please
excuse any epic mistake that I may have made through the mail!

Finally, I am not sure if it is better to post here or ask for help on
IRC, anybody on this?

Sorry for the many questions and for the noise and thanks in advance for
any little help.
Alessandro

 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]