Require a DISPLAY to be set instead of Xvfb to be running for the window manager.

develop
Icedream 2015-11-04 23:33:44 +01:00
parent bfb0ff154b
commit 2b7da8705f
1 changed files with 8 additions and 5 deletions

View File

@ -8,7 +8,6 @@ xwmBinPath = require_bin "x-window-manager", false
module.exports = class XWindowManagerService extends services.Service
dependencies: [
"xvfb"
]
constructor: -> super "XWindowManager",
start: (cb) ->
@ -16,6 +15,14 @@ module.exports = class XWindowManagerService extends services.Service
cb? new Error "A window manager not available."
return
if not process.env.XDG_RUNTIME_DIR? or process.env.XDG_RUNTIME_DIR.trim() == ""
cb? new Error "XDG runtime directory needs to be set."
return
if not process.env.DISPLAY? or process.env.DISPLAY.trim() == ""
cb? new Error "There is no display to run TeamSpeak3 on."
return
if @process
cb? null, @process
return
@ -25,10 +32,6 @@ module.exports = class XWindowManagerService extends services.Service
proc = null
doStart = null
doStart = () =>
await services.find("xvfb").start defer(err)
if err
throw new Error "Dependency xvfb failed."
proc = spawn xwmBinPath, [],
stdio: ['ignore', 'pipe', 'pipe']
detached: true