Unix signals
- From: Alberto José Rodríguez Rodríguez <ajrodriguez blulabs es>
- To: javascript-list gnome org
- Subject: Unix signals
- Date: Tue, 04 Sep 2012 20:20:12 +0200
Hello,
I'm writting a gjs script that shows mplayer embedded in a GtkWindow. My
problem is that if the main process receives a SIGSTOP or a SIGQUIT, it
isn't propagated to the mplayer process. Is it possible to trap unix
signals in gjs scripts? Or, is it possible to launch the mplayer process
in the process group of the main process?
Thanks,
#! /usr/bin/gjs
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const GdkX11 = imports.gi.GdkX11;
const Lang = imports.lang;
if (ARGV.length != 1) {
printerr("No uri specified");
} else {
Gtk.init(null);
let window = new Gtk.Window ({ decorated: false,
window_position: Gtk.WindowPosition.CENTER,
title: "TestMPlayer",
});
window.fullscreen();
window.show_all();
let [s, argv] = GLib.shell_parse_argv('mplayer -really-quiet -slave
-noidle -noconsolecontrols -loop 0 -wid ' + window.window.get_xid() + '
' + ARGV[0]);
let [success, pid] = GLib.spawn_async(null, argv, null,
GLib.SpawnFlags.SEARCH_PATH,
null, null);
window.connect('destroy', function() {
GLib.spawn_command_line_sync('kill ' + pid);
Gtk.main_quit();
}
);
Gtk.main();
}
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]