Re: missing workflows with gnome-shell



Il giorno lun, 07/02/2011 alle 10.21 +0100, Thomas Bouffon ha scritto:
> Hi Alessandro,
> 
> 
>         Are you sure? I'm using it with an up to date Shell build, and
>         if I open
>         an app that has to go on the fourth workspace *from the
>         terminal*, that
>         workspace is created and the app moved there.
> Yes I am : if the extension has to create a workspace, gnome-shell
> crashes (I attached the terminal output in err.txt)
> 
> 
>         Am I missing something or are you checking out the
>         workspace-thumbnails
>         branch? Could you please tell me what is not working in your
>         setup, mine
>         seems perfectly functional :)
> I'm building with the jhbuild script, so I guess, that's the regular
> branch. (version  GNOME Shell 2.91.5). Maybe You modified some little
> bit in the extension which makes it work ? Can you post the js file,
> so that I can try it (You'll have to change the extension, as js files
> are refused by the mailing list)

I'm copy and pasting it here, it's not that long. It is a slightly
modified version of your extension (renamed variables and minor edits, I
rewrote it for learning purposes, hope you don't mind), that does not
use Gconf (I planned to add class and titles and I wanted an easily
modifiable config, so I'm directly using an array in the extension).
Here it is, and it works with an up to today build (2.91.6):

// Start apps on custom workspaces

const St = imports.gi.St;
const Mainloop = imports.mainloop;
const Glib = imports.gi.GLib;
const Main = imports.ui.main;
const Shell = imports.gi.Shell;

function FindAndMove (display, window) {
	// Startup workspace for custom apps configuration
	let spaces = new Array();
	spaces[0]="Rhythmbox:2"
	spaces[1]="Evolution:1"
	spaces[2]="Liferea:1"
	spaces[3]="Gtg:3"

	for ( let j = 0 ; j < spaces.length; j++ ) {
		let apps_to_space = spaces[j].split(":");
		let match_expression = new RegExp(apps_to_space[0],"g");
		// Match window
		if ( window.get_wm_class().match(match_expression) ) {
			for ( let j = global.screen.n_workspaces; j <= apps_to_space[1] ; j
++ ) {
				global.screen.append_new_workspace(false,0);
			}

window.change_workspace_by_index(apps_to_space[1],false,global.get_current_time());
		}
	}
}
function main() {
	let display = global.screen.get_display();
	display.connect('window-created',FindAndMove);
}



> 
> 
>         Beside, are you planning to ditch Gconf in the extension? I
>         would like
>         to store settings through Gsettings, I have also planned to
>         add more
>         features, like window class matching and geometry setting, but
>         I never
>         had the time to do it.
> I'm not that much of a planner, but if gsettings enables to use a nice
> gui for the settings, why not ? 
> But I couldn't find much about how it works : gsettings stores info
> somewhere, but are these settings accessible  through "System
> settings" ? I guess that once we master the settings management, we'll
> be able to start playing with the class/name/application, and being
> able to chose among these.
> 

That's the problem. I'm clueless about Gsettings and how to store into|
use|abuse it. As usual, I should do a little bit of research, but I have
yet to find an agreement with my to-do list :)

Cheers,
Alessandro






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