Beautiful: handle invalid wallpaper_cmd better (FS#941)
(upstream git commit d3021e67729a01e891c8eb04a8afd696fb63b0ce)
This commit is contained in:
parent
abb8ddf57d
commit
e53a2fc324
@ -1,8 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.43 2011/11/30 11:50:58 dcoppa Exp $
|
||||
# $OpenBSD: Makefile,v 1.44 2011/12/05 16:12:01 dcoppa Exp $
|
||||
|
||||
COMMENT= fast, small, dynamic and awesome window manager
|
||||
|
||||
DISTNAME= awesome-3.4.11
|
||||
REVISION= 0
|
||||
EXTRACT_SUFX= .tar.xz
|
||||
CATEGORIES= x11
|
||||
|
||||
|
38
x11/awesome/patches/patch-lib_beautiful_lua_in
Normal file
38
x11/awesome/patches/patch-lib_beautiful_lua_in
Normal file
@ -0,0 +1,38 @@
|
||||
$OpenBSD: patch-lib_beautiful_lua_in,v 1.1 2011/12/05 16:12:01 dcoppa Exp $
|
||||
|
||||
Beautiful: handle invalid wallpaper_cmd better (FS#941)
|
||||
(upstream git commit d3021e67729a01e891c8eb04a8afd696fb63b0ce)
|
||||
|
||||
--- lib/beautiful.lua.in.orig Wed Nov 23 15:08:50 2011
|
||||
+++ lib/beautiful.lua.in Mon Dec 5 16:59:39 2011
|
||||
@@ -29,11 +29,11 @@ module("beautiful")
|
||||
-- Local data
|
||||
local theme
|
||||
|
||||
-local wallpaper = {}
|
||||
-- Checks the entries in the wallpaper_cmd are valid.
|
||||
-- @param tw A table with wallpaper commands.
|
||||
--- @return False if tw length is zero or if any entries in tw are not strings.
|
||||
-function wallpaper.is_valid(tw)
|
||||
+-- @return False if there is no way that this can be a valid wallpaper cmd.
|
||||
+local function wallpaper_is_valid(tw)
|
||||
+ if type(tw) ~= 'table' then return false end
|
||||
for _, v in pairs(tw) do
|
||||
if type(v) ~= 'string' then return false end
|
||||
end
|
||||
@@ -60,9 +60,14 @@ function init(path)
|
||||
end
|
||||
|
||||
-- setup wallpaper
|
||||
- if wallpaper.is_valid(theme.wallpaper_cmd) then
|
||||
+ if wallpaper_is_valid(theme.wallpaper_cmd) then
|
||||
for s = 1, capi.screen.count() do
|
||||
util.spawn(theme.wallpaper_cmd[util.cycle(#theme.wallpaper_cmd, s)], false, s)
|
||||
+ end
|
||||
+ else
|
||||
+ if theme.wallpaper_cmd then
|
||||
+ -- There is a wallpaper_cmd, but wallpaper_is_valid doesn't like it
|
||||
+ print("W: beautiful: invalid wallpaper_cmd in theme file " .. path)
|
||||
end
|
||||
end
|
||||
if theme.font then capi.awesome.font = theme.font end
|
Loading…
x
Reference in New Issue
Block a user