mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-14 23:33:38 +00:00
1. Added 'getProcess' to process-manager for posix platforms with pgrep
2. Fixed parsing bug in user-sessions.getEnvFromPid 3. Updated linux-gnome-helpers to set environment and uid before calling gsettings
This commit is contained in:
@@ -51,8 +51,11 @@ function gnome_getDesktopWallpaper(uid)
|
||||
function gnome_setDesktopWallpaper(uid, filePath)
|
||||
{
|
||||
if (!filePath) { filePath = '/dev/null'; }
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh'], { env: { HOME: require('user-sessions').getHomeFolder(uid) } });
|
||||
child.stderr.str = ''; child.stderr.on('data', function (c) { });
|
||||
var v = { HOME: require('user-sessions').getHomeFolder(uid), DBUS_SESSION_BUS_ADDRESS: require('user-sessions').getEnvFromPid(require('process-manager').getProcess('gnome-session')).DBUS_SESSION_BUS_ADDRESS };
|
||||
|
||||
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh'], { uid: uid, env: v });
|
||||
child.stderr.str = ''; child.stderr.on('data', function (c) { this.str += c.toString(); });
|
||||
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
|
||||
child.stdin.write('gsettings set org.gnome.desktop.background picture-uri file://' + filePath + '\nexit\n');
|
||||
child.waitExit();
|
||||
|
||||
Reference in New Issue
Block a user