From 2e97991a901b73c1926628b92f7ecc1b098c8f87 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 13 Nov 2008 11:53:41 +0100 Subject: [PATCH] beautiful: merge awful.beautiful, stop registering system Signed-off-by: Julien Danjou --- awesomerc.lua.in | 13 +++---------- lib/awful/beautiful.lua.in | 33 --------------------------------- lib/awful/init.lua.in | 1 - lib/awful/menu.lua.in | 2 +- lib/awful/prompt.lua.in | 2 +- lib/awful/titlebar.lua.in | 2 +- lib/awful/widget.lua.in | 2 +- lib/beautiful.lua.in | 6 ++++++ lib/invaders.lua.in | 2 +- lib/naughty.lua.in | 2 +- 10 files changed, 15 insertions(+), 50 deletions(-) delete mode 100644 lib/awful/beautiful.lua.in diff --git a/awesomerc.lua.in b/awesomerc.lua.in index 0ef70320f..cd7b11bcb 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -9,6 +9,9 @@ theme_path = "@AWESOME_THEMES_PATH@/default/theme" -- Uncommment this for a lighter theme -- theme_path = "@AWESOME_THEMES_PATH@/sky/theme" +-- Actually load theme +beautiful.init(theme_path) + -- This is used later as the default terminal and editor to run. terminal = "xterm" editor = os.getenv("EDITOR") or "nano" @@ -64,16 +67,6 @@ apptags = use_titlebar = false -- }}} --- {{{ Initialization --- Initialize theme (colors). -beautiful.init(theme_path) - --- Register theme in awful. --- This allows to not pass plenty of arguments to each function --- to inform it about colors we want it to draw. -awful.beautiful.register(beautiful) --- }}} - -- {{{ Tags -- Define tags table. tags = {} diff --git a/lib/awful/beautiful.lua.in b/lib/awful/beautiful.lua.in deleted file mode 100644 index e1f2f8554..000000000 --- a/lib/awful/beautiful.lua.in +++ /dev/null @@ -1,33 +0,0 @@ ---------------------------------------------------------------------------- --- @author Julien Danjou <julien@danjou.info> --- @copyright 2008 Julien Danjou --- @release @AWESOME_VERSION@ ---------------------------------------------------------------------------- - -local package = package - ---- Beautiful module for awful -module("awful.beautiful") - --- Exported variable handling theme. -theme = {} - ---- Register the beautiful theme if beautiful is used. --- That allows various awful functions (and maybe other module using the --- awful.beautiful.get() method) to use colors theme as defined in beautiful. --- @param The beautiful theme. -function register(btheme) - if btheme then - theme = btheme - else - theme = {} - end -end - ---- Get the current registered theme. --- @return The current theme table. -function get() - return package.loaded.awful.beautiful.theme -end - --- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/lib/awful/init.lua.in b/lib/awful/init.lua.in index fc6eb31dc..9242757d4 100644 --- a/lib/awful/init.lua.in +++ b/lib/awful/init.lua.in @@ -4,7 +4,6 @@ -- @release @AWESOME_VERSION@ --------------------------------------------------------------------------- -local beautiful = require("awful.beautiful") local client = require("awful.client") local completion = require("awful.completion") local hooks = require("awful.hooks") diff --git a/lib/awful/menu.lua.in b/lib/awful/menu.lua.in index b99a69104..0949dc5bb 100644 --- a/lib/awful/menu.lua.in +++ b/lib/awful/menu.lua.in @@ -16,7 +16,7 @@ local button = button local capi = { screen = screen, mouse = mouse, client = client } local util = require("awful.util") local tags = require("awful.tag") -local awbeautiful = require("awful.beautiful") +local awbeautiful = require("beautiful") --- Menu module for awful module("awful.menu") diff --git a/lib/awful/prompt.lua.in b/lib/awful/prompt.lua.in index 1ae31ceee..f97d4a834 100644 --- a/lib/awful/prompt.lua.in +++ b/lib/awful/prompt.lua.in @@ -14,7 +14,7 @@ local capi = keygrabber = keygrabber } local util = require("awful.util") -local beautiful = require("awful.beautiful") +local beautiful = require("beautiful") --- Prompt module for awful module("awful.prompt") diff --git a/lib/awful/titlebar.lua.in b/lib/awful/titlebar.lua.in index 02bbd90c4..553b4d3ca 100644 --- a/lib/awful/titlebar.lua.in +++ b/lib/awful/titlebar.lua.in @@ -15,7 +15,7 @@ local capi = button = button, client = client, } -local beautiful = require("awful.beautiful") +local beautiful = require("beautiful") local hooks = require("awful.hooks") local util = require("awful.util") local widget = require("awful.widget") diff --git a/lib/awful/widget.lua.in b/lib/awful/widget.lua.in index 701b9c24f..49085ff56 100644 --- a/lib/awful/widget.lua.in +++ b/lib/awful/widget.lua.in @@ -18,7 +18,7 @@ local capi = } local util = require("awful.util") local hooks = require("awful.hooks") -local beautiful = require("awful.beautiful") +local beautiful = require("beautiful") local menu = require("awful.menu") --- Widget module for awful diff --git a/lib/beautiful.lua.in b/lib/beautiful.lua.in index c2e828ab2..239cfc701 100644 --- a/lib/beautiful.lua.in +++ b/lib/beautiful.lua.in @@ -87,6 +87,12 @@ function init(path) end end +--- Get the current theme. +-- @return The current theme table. +function get() + return package.loaded[module_name] +end + setmetatable(package.loaded[module_name], package.loaded[module_name]) -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/lib/invaders.lua.in b/lib/invaders.lua.in index e5c054371..ee6522109 100644 --- a/lib/invaders.lua.in +++ b/lib/invaders.lua.in @@ -25,7 +25,7 @@ local wibox = wibox local widget = widget local awful = require("awful") -local beautiful = require("awful.beautiful") +local beautiful = require("beautiful") local image = image local capi = { screen = screen, mouse = mouse, keygrabber = keygrabber } diff --git a/lib/naughty.lua.in b/lib/naughty.lua.in index c19473774..59dffd134 100644 --- a/lib/naughty.lua.in +++ b/lib/naughty.lua.in @@ -26,7 +26,7 @@ local string = string local widget = widget local button = button local capi = { screen = screen } -local bt = require("awful.beautiful") +local bt = require("beautiful") local beautiful = bt.get() --- Notification library