Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unity integration for node-x11
[Desktop Entry]
Name=Unity Launcher test
GenericName=Oooooooooooooooooooooooooooo
Comment=Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Exec=/home/laplace/ltest/test.js
Icon=system-software-update
Terminal=false
Type=Application
Categories=System;Settings;
#!/usr/bin/env node
var dbus = require('dbus-native');
var bus = dbus.sessionBus();
var menu = require('./menu1');
var dbusmenu = require('dbusmenu');
var x11 = require('x11');
var pro = 0.1
function set() {
bus.connection.message({
type: 4,
flags: 1,
signature: 'sa{sv}',
path: "/com/canonical/unity/launcherentry/353109048",
member: "Update",
interface: "com.canonical.Unity.LauncherEntry",
body: [
//"application://gnome-terminal.desktop",
"application://launcher-test.desktop",
[
["quicklist", ['s', '/some/wid/path']],
["progress-visible", ['b', true ]],
["progress", ['d', pro ]]
]
]
});
pro += 0.05;
if (pro < 0.9)
setTimeout(set, 1000);
}
setTimeout(set, 1000);
x11.createClient(function(err, display) {
var X = display.client;
var wid = X.AllocID();
X.CreateWindow(wid, display.screen[0].root, 100, 100, 400, 300);
X.MapWindow(wid);
var mainmenu = dbusmenu.createMenu(bus, wid, '/some/wid/path', menu);
//mainmenu.on('clicked', function(id, menuitem) {
// console.log(id, menuitem);
//});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.