This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var x11 = require('../../lib/x11'); | |
| x11.createClient(function(display) { | |
| X = display.client; | |
| var w = 100; | |
| var h = 200; | |
| var root = display.screen[0].root; | |
| var pix = X.AllocID(); | |
| X.CreatePixmap(pix, root, 32, w, h); | |
| var gc = X.AllocID(); | |
| X.CreateGC(gc, root); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Copyright 1986, 1998 The Open Group | |
| Permission to use, copy, modify, distribute, and sell this software and its | |
| documentation for any purpose is hereby granted without fee, provided that | |
| the above copyright notice appear in all copies and that both that | |
| copyright notice and this permission notice appear in supporting | |
| documentation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var x11 = require('x11'); | |
| x11.createClient(function(display) { | |
| X = display.client; | |
| root = display.screen[0].root; | |
| X.ChangeWindowAttributes(root, { eventMask: x11.eventMask.SubstructureRedirect }, function(err) { | |
| if (err.error == 10) | |
| { | |
| console.error('Error: another window manager already running.'); | |
| process.exit(1); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import xcb | |
| import xcb.xproto as xproto | |
| conn = xcb.connect() | |
| root = conn.get_setup().roots[0].root | |
| conn.core.ChangeWindowAttributesChecked(self.root, xproto.CW.EventMask, [xproto.EventMask.SubstructureRedirect|xproto.EventMask.SubstructureNotify]) | |
| while True: | |
| e = conn.wait_for_event() | |
| print e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var exec = require("child_process").exec; | |
| require('http').createServer(function(req, response) { | |
| console.log("Request handler 'start' was called."); | |
| var content = "empty"; | |
| exec("ls -lah", function(error, stdout, stderr) { | |
| response.writeHead(200, {"Content-type":"text/plain"}); | |
| response.write(stdout); | |
| console.log(stdout); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var exec = require("child_process").exec; | |
| require('http').createServer(function(req, response) { | |
| console.log("Request handler 'start' was called."); | |
| var content = "empty"; | |
| exec("ls -lah", function(error, stdout, stderr) { | |
| response.writeHead(200, {"Content-type":"text/plain"}); | |
| response.write(stdout); | |
| console.log(stdout); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sidorares@sidorares-VirtualBox:~$ ls -l /tmp/fuse/org.freedesktop.NetworkManager/org/freedesktop/NetworkManager/org.freedesktop.NetworkManager/ | |
| total 0 | |
| -r-xr-xr-x 0 root root 175 Jan 1 1970 ActivateConnection | |
| -r--r--r-- 0 root root 60 Jan 1 1970 ActiveConnections | |
| -r-xr-xr-x 0 root root 181 Jan 1 1970 AddAndActivateConnection | |
| -r-xr-xr-x 0 root root 177 Jan 1 1970 DeactivateConnection | |
| -r-xr-xr-x 0 root root 163 Jan 1 1970 Enable | |
| -r-xr-xr-x 0 root root 175 Jan 1 1970 GetDeviceByIpIface | |
| -r-xr-xr-x 0 root root 167 Jan 1 1970 GetDevices | |
| -r-xr-xr-x 0 root root 171 Jan 1 1970 GetPermissions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var dbus = require('dbus-native'); | |
| var bus = dbus.systemBus(); | |
| udservice = bus.getService('org.freedesktop.UDisks'); | |
| udservice.getInterface( | |
| '/org/freedesktop/UDisks', | |
| 'org.freedesktop.UDisks', | |
| function(err, ud) { | |
| ud.on('DeviceAdded', function(deviceObjectPath) { | |
| console.log('DeviceAdded', deviceObjectPath); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Xvfb :1 ⏎ | |
| Initializing built-in extension Generic Event Extension | |
| Initializing built-in extension SHAPE | |
| Initializing built-in extension MIT-SHM | |
| Initializing built-in extension XInputExtension | |
| Initializing built-in extension XTEST | |
| Initializing built-in extension BIG-REQUESTS | |
| Initializing built-in extension SYNC | |
| Initializing built-in extension XKEYBOARD | |
| Initializing built-in extension XC-MISC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| laplace@laplace-VirtualBox:~/node-x11$ DISPLAY=:0 ./a.out | |
| 93 0 | |
| 1 0 128305 0 | |
| laplace@laplace-VirtualBox:~/node-x11$ DISPLAY=:0 ./a.out | |
| 93 0 | |
| 1 0 129993 0 | |
| laplace@laplace-VirtualBox:~/node-x11$ DISPLAY=:0 ./a.out | |
| 93 0 | |
| 3 0 1268 0 | |
| laplace@laplace-VirtualBox:~/node-x11$ DISPLAY=:0 ./a.out |