mirror of https://github.com/icedream/ts3bot.git
Require a DISPLAY to be set instead of Xvfb to be running for the window manager.
parent
bfb0ff154b
commit
2b7da8705f
|
@ -8,7 +8,6 @@ xwmBinPath = require_bin "x-window-manager", false
|
||||||
|
|
||||||
module.exports = class XWindowManagerService extends services.Service
|
module.exports = class XWindowManagerService extends services.Service
|
||||||
dependencies: [
|
dependencies: [
|
||||||
"xvfb"
|
|
||||||
]
|
]
|
||||||
constructor: -> super "XWindowManager",
|
constructor: -> super "XWindowManager",
|
||||||
start: (cb) ->
|
start: (cb) ->
|
||||||
|
@ -16,6 +15,14 @@ module.exports = class XWindowManagerService extends services.Service
|
||||||
cb? new Error "A window manager not available."
|
cb? new Error "A window manager not available."
|
||||||
return
|
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
|
if @process
|
||||||
cb? null, @process
|
cb? null, @process
|
||||||
return
|
return
|
||||||
|
@ -25,10 +32,6 @@ module.exports = class XWindowManagerService extends services.Service
|
||||||
proc = null
|
proc = null
|
||||||
doStart = null
|
doStart = null
|
||||||
doStart = () =>
|
doStart = () =>
|
||||||
await services.find("xvfb").start defer(err)
|
|
||||||
if err
|
|
||||||
throw new Error "Dependency xvfb failed."
|
|
||||||
|
|
||||||
proc = spawn xwmBinPath, [],
|
proc = spawn xwmBinPath, [],
|
||||||
stdio: ['ignore', 'pipe', 'pipe']
|
stdio: ['ignore', 'pipe', 'pipe']
|
||||||
detached: true
|
detached: true
|
||||||
|
|
Loading…
Reference in New Issue