wallpaper
Advanced tools
Comparing version 2.6.0 to 3.0.0
101
lib/linux.js
@@ -29,15 +29,26 @@ 'use strict'; | ||
cmd: 'setroot', | ||
set: ['%s'] | ||
set: [ | ||
'%s' | ||
] | ||
}, | ||
{ | ||
cmd: 'pcmanfm', | ||
set: ['-w %s'] | ||
set: [ | ||
'-w %s' | ||
] | ||
}, | ||
{ | ||
cmd: 'feh', | ||
set: ['--bg-scale', '%s'] | ||
set: [ | ||
'--bg-scale', | ||
'%s' | ||
] | ||
}, | ||
{ | ||
cmd: 'nitrogen', | ||
set: ['--set-zoom-fill', '--save', '%s'], | ||
set: [ | ||
'--set-zoom-fill', | ||
'--save', | ||
'%s' | ||
], | ||
get: [], | ||
@@ -48,3 +59,4 @@ transform: imagePath => imagePath.trim().split('\n').slice(-1)[0] | ||
cmd: 'xfconf-query', | ||
set: ['-c xfce4-desktop', | ||
set: [ | ||
'-c xfce4-desktop', | ||
'-p /backdrop/screen0/monitor0/image-path', | ||
@@ -56,3 +68,4 @@ '-s %s' | ||
cmd: 'gconftool-2', | ||
set: ['--set', | ||
set: [ | ||
'--set', | ||
'/desktop/gnome/background/picture_filename', | ||
@@ -65,3 +78,4 @@ '--type=string', | ||
cmd: 'dcop', | ||
set: ['kdesktop', | ||
set: [ | ||
'kdesktop', | ||
'KBackgroundIface', | ||
@@ -74,7 +88,9 @@ 'setWallpaper', | ||
cmd: 'dconf', | ||
set: ['write', | ||
set: [ | ||
'write', | ||
'/org/mate/desktop/background/picture-filename', | ||
'"%s"' | ||
], | ||
get: ['read', | ||
get: [ | ||
'read', | ||
'/org/mate/desktop/background/picture-filename' | ||
@@ -97,4 +113,3 @@ ], | ||
} | ||
` | ||
] | ||
`] | ||
} | ||
@@ -118,3 +133,3 @@ ]; | ||
return cp.exec(whichCmd).then(stdout => { | ||
return cp.exec(`echo $(${whichCmd})`).then(stdout => { | ||
stdout = stdout.trim(); | ||
@@ -176,23 +191,23 @@ | ||
return isCinnamon() | ||
.then(cinnamon => { | ||
if (cinnamon) { | ||
getArgs[1] = 'org.cinnamon.desktop.background'; | ||
} | ||
}) | ||
.then(() => isMATE()) | ||
.then(mate => { | ||
if (mate) { | ||
getArgs.splice(1, 2, 'org.mate.background', 'picture-filename'); | ||
} | ||
}) | ||
.then(() => cp.execFile(app.cmd, getArgs)) | ||
.then(stdout => { | ||
stdout = stdout.trim(); | ||
.then(cinnamon => { | ||
if (cinnamon) { | ||
getArgs[1] = 'org.cinnamon.desktop.background'; | ||
} | ||
}) | ||
.then(() => isMATE()) | ||
.then(mate => { | ||
if (mate) { | ||
getArgs.splice(1, 2, 'org.mate.background', 'picture-filename'); | ||
} | ||
}) | ||
.then(() => cp.execFile(app.cmd, getArgs)) | ||
.then(stdout => { | ||
stdout = stdout.trim(); | ||
if (typeof app.transform === 'function') { | ||
return app.transform(stdout); | ||
} | ||
if (typeof app.transform === 'function') { | ||
return app.transform(stdout); | ||
} | ||
return stdout; | ||
}); | ||
return stdout; | ||
}); | ||
} | ||
@@ -227,14 +242,14 @@ | ||
return isCinnamon() | ||
.then(cinnamon => { | ||
if (cinnamon) { | ||
params[1] = 'org.cinnamon.desktop.background'; | ||
} | ||
}) | ||
.then(() => isMATE()) | ||
.then(mate => { | ||
if (mate) { | ||
params.splice(1, 3, 'org.mate.background', 'picture-filename', params[3].replace(/^file:\/\//, '')); | ||
} | ||
}) | ||
.then(() => cp.execFile(app.cmd, params)); | ||
.then(cinnamon => { | ||
if (cinnamon) { | ||
params[1] = 'org.cinnamon.desktop.background'; | ||
} | ||
}) | ||
.then(() => isMATE()) | ||
.then(mate => { | ||
if (mate) { | ||
params.splice(1, 3, 'org.mate.background', 'picture-filename', params[3].replace(/^file:\/\//, '')); | ||
} | ||
}) | ||
.then(() => cp.execFile(app.cmd, params)); | ||
} | ||
@@ -241,0 +256,0 @@ |
{ | ||
"name": "wallpaper", | ||
"version": "2.6.0", | ||
"description": "Get or set the desktop wallpaper", | ||
"license": "MIT", | ||
"repository": "sindresorhus/wallpaper", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"lib" | ||
], | ||
"keywords": [ | ||
"win", | ||
"windows", | ||
"macos", | ||
"osx", | ||
"linux", | ||
"wallpaper", | ||
"desktop", | ||
"background", | ||
"image", | ||
"picture", | ||
"photo" | ||
], | ||
"dependencies": { | ||
"pify": "^2.3.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"esnext": true | ||
} | ||
"name": "wallpaper", | ||
"version": "3.0.0", | ||
"description": "Get or set the desktop wallpaper", | ||
"license": "MIT", | ||
"repository": "sindresorhus/wallpaper", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"lib" | ||
], | ||
"keywords": [ | ||
"macos", | ||
"linux", | ||
"windows", | ||
"wallpaper", | ||
"desktop", | ||
"background", | ||
"image", | ||
"picture", | ||
"photo" | ||
], | ||
"dependencies": { | ||
"pify": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
} |
@@ -11,3 +11,3 @@ # wallpaper [![Build Status](https://travis-ci.org/sindresorhus/wallpaper.svg?branch=master)](https://travis-ci.org/sindresorhus/wallpaper) [![Build status](https://ci.appveyor.com/api/projects/status/xhwaihmhhplh5d05/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/wallpaper/branch/master) | ||
``` | ||
$ npm install --save wallpaper | ||
$ npm install wallpaper | ||
``` | ||
@@ -14,0 +14,0 @@ |
Sorry, the diff of this file is not supported yet
254
47021
+ Addedpify@3.0.0(transitive)
- Removedpify@2.3.0(transitive)
Updatedpify@^3.0.0