diff --git a/lib/awful.lua.in b/lib/awful.lua.in index bbfcc82ca..df2435cfc 100644 --- a/lib/awful.lua.in +++ b/lib/awful.lua.in @@ -824,10 +824,11 @@ end --- Spawn a program. -- @param cmd The command. +-- @param screen The screen where to spawn window. -- @return The awesome.spawn return value. -function spawn(cmd) +function spawn(cmd, screen) if cmd and cmd ~= "" then - return capi.awesome.spawn(cmd .. "&", capi.mouse.screen) + return capi.awesome.spawn(cmd .. "&", screen or capi.mouse.screen) end end diff --git a/lib/beautiful.lua.in b/lib/beautiful.lua.in index 3c5a9ca34..cc85c398a 100644 --- a/lib/beautiful.lua.in +++ b/lib/beautiful.lua.in @@ -11,7 +11,11 @@ local print = print local setmetatable = setmetatable local awful = require("awful") local package = package -local capi = { awesome = awesome } +local capi = +{ + screen = screen, + awesome = awesome +} local module_name = "beautiful" @@ -64,7 +68,9 @@ function init(path) key, value = split_line(line) if key then if key == "wallpaper_cmd" then - awful.spawn(value) + for s = 1, capi.screen.count() do + awful.spawn(value, s) + end elseif key == "font" then capi.awesome.font_set(value) elseif key == "fg_normal" then